most features are implemented #4
@ -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<std::chrono::seconds>(start_to_epoch);
|
||||
int start_seconds = start_value.count();
|
||||
|
||||
auto end_to_epoch = end.time_since_epoch();
|
||||
auto end_value = std::chrono::duration_cast<std::chrono::seconds>(start_to_epoch);
|
||||
int end_seconds = end_value.count();
|
||||
std::cout << "<" << start_seconds << "-" << end_seconds << ">" ;
|
||||
}
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user