| 49 | } |
| 50 | |
| 51 | void StopWatch::stop() |
| 52 | { |
| 53 | if (!is_running_) |
| 54 | { |
| 55 | throw Exception::Precondition(__FILE__, __LINE__, OPENMS_PRETTY_FUNCTION, "StopWatch cannot be stopped if not running!"); |
| 56 | } |
| 57 | |
| 58 | TimeDiff_ now = snapShot_(); |
| 59 | auto diff = now - last_start_; |
| 60 | accumulated_times_ += diff; |
| 61 | |
| 62 | is_running_ = false; |
| 63 | } |
| 64 | |
| 65 | void StopWatch::resume() |
| 66 | { |
no outgoing calls
no test coverage detected