| 61 | } |
| 62 | |
| 63 | double Timer::resetTime(Timer::timer_info& info) { |
| 64 | auto current_duration = info.time; |
| 65 | info.time = clock_type::duration{0}; |
| 66 | if (info.running) { |
| 67 | const auto current_time = clock_type::now(); |
| 68 | const auto elapsed = current_time - info.started; |
| 69 | current_duration += elapsed; |
| 70 | info.started = current_time; |
| 71 | info.total_time += elapsed; |
| 72 | } |
| 73 | return seconds{current_duration}.count(); |
| 74 | } |
| 75 | |
| 76 | void Timer::printTimeReport() { |
| 77 | using namespace std::string_literals; |