| 87 | } |
| 88 | |
| 89 | double Duration::TimeRemaining() const |
| 90 | { |
| 91 | if (IsReset()) { |
| 92 | return Seconds(); |
| 93 | } |
| 94 | auto runTime = std::chrono::duration_cast<std::chrono::milliseconds>( |
| 95 | std::chrono::high_resolution_clock::now() - _startTime); |
| 96 | |
| 97 | if (runTime.count() >= Milliseconds()) { |
| 98 | return 0; |
| 99 | } |
| 100 | return (Milliseconds() - runTime.count()) / 1000.0; |
| 101 | } |
| 102 | |
| 103 | void Duration::SetTimeRemaining(double remaining) |
| 104 | { |
no test coverage detected