Returns the elapsed time for a hms_timer() as a hms_timer().

tmr_elapsed(x)

Arguments

x

A hms_timer().

Value

A hms_timer() of the elapsed time.

Details

The elapsed time is the value of the scalar plus the difference between the current system time and the system time when the timer was started.

If the original hms_timer() was running then the new hms_timer() is assigned an attribute named start of the current system time.

See also

Examples

tmr <- tmr_start(tmr_timer())
print(tmr_elapsed(tmr))
#> 00:00:00.001235
Sys.sleep(0.01)
print(tmr_elapsed(tmr))
#> 00:00:00.023118
tmr <- tmr_stop(tmr)
print(tmr_elapsed(tmr))
#> 00:00:00.025321
Sys.sleep(0.01)
print(tmr_elapsed(tmr))
#> 00:00:00.025321