timer_resume measures the paused interval and adds it to paused_ticks.
A later timer_stop subtracts those ticks from the wall-clock interval.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(timer), | intent(inout) | :: | this |
Paused wall-clock timer instance to resume. |
subroutine timer_resume(this) class(timer), intent(inout) :: this !! Paused wall-clock timer instance to resume. integer(ik) :: clock_now !! Tick captured from `system_clock` at resume time. integer(ik) :: pause_dt !! Tick duration between `timer_pause` and this resume call. if (.not. this%is_started) then write(error_unit, '(A)') 'Warning: timer_resume called before timer_start.' return end if if (.not. this%is_paused) then write(error_unit, '(A)') 'Warning: timer is not paused.' return end if call system_clock(count=clock_now) pause_dt = ticks_diff(clock_now, this%pause_start, this%clock_max) if (pause_dt > 0_ik) this%paused_ticks = this%paused_ticks + pause_dt this%is_paused = .false. end subroutine timer_resume