Skip to contents

Stops a hms_timer() after updating it to the elapsed time.

Usage

tmr_stop(x)

Arguments

x

A hms_timer().

Value

A stopped hms_timer().

Details

If the hms_timer() is already stopped, the function simply issues a warning and returns the original object.

See also

Examples

tmr <- tmr_stop(tmr_timer(start = TRUE))
print(tmr_elapsed(tmr))
#> 00:00:00.000028
Sys.sleep(0.01)
print(tmr_elapsed(tmr))
#> 00:00:00.000028