Skip to contents

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

Usage

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.000499
Sys.sleep(0.01)
print(tmr_elapsed(tmr))
#> 00:00:00.012044
tmr <- tmr_stop(tmr)
print(tmr_elapsed(tmr))
#> 00:00:00.013237
Sys.sleep(0.01)
print(tmr_elapsed(tmr))
#> 00:00:00.013237