diff --git a/Park_time.cpp b/Park_time.cpp index 267e0c0..26f319b 100644 --- a/Park_time.cpp +++ b/Park_time.cpp @@ -42,4 +42,15 @@ std::ostream& operator<<(std::ostream& os, const Park_time & pt){ os << "duration : " << pt.duration << "\n"; os << "- - - - - - - - - - - - - - - - - - - -\n"; return os; +} + +void Park_time::debug() { + auto start_to_epoch = start.time_since_epoch(); + auto start_value = std::chrono::duration_cast(start_to_epoch); + int start_seconds = start_value.count(); + + auto end_to_epoch = end.time_since_epoch(); + auto end_value = std::chrono::duration_cast(start_to_epoch); + int end_seconds = end_value.count(); + std::cout << "<" << start_seconds << "-" << end_seconds << ">" ; } \ No newline at end of file diff --git a/headers/Park_time.h b/headers/Park_time.h index 435234a..a98d9c8 100644 --- a/headers/Park_time.h +++ b/headers/Park_time.h @@ -30,6 +30,7 @@ public: Park_time(int c_id, int s_id); void clock_out(int c_id, int s_id); friend std::ostream& operator<<(std::ostream& os, const Park_time & pt); + void debug(); private: high_resolution_clock::time_point start; diff --git a/test.db3 b/test.db3 index 0a82dfa..10a2d99 100644 Binary files a/test.db3 and b/test.db3 differ