tmr_elapsed {hmstimer}R Documentation

Elapsed Time hms Timer

Description

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

Usage

tmr_elapsed(x)

Arguments

x

A hms_timer().

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.

Value

A hms_timer() of the elapsed time.

See Also

Other start_stop: tmr_is_started(), tmr_is_stopped(), tmr_print(), tmr_reset(), tmr_start(), tmr_stop(), tmr_timer()

Examples

tmr <- tmr_start(tmr_timer())
print(tmr_elapsed(tmr))
Sys.sleep(0.01)
print(tmr_elapsed(tmr))
tmr <- tmr_stop(tmr)
print(tmr_elapsed(tmr))
Sys.sleep(0.01)
print(tmr_elapsed(tmr))

[Package hmstimer version 0.2.1 Index]