hmstimer
is an R package to track elapsed clock time
using a hms::hms scalar,
which if running has an attribute named start that specifies the system
time when the timer was started.
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.
library(hmstimer)
<- tmr_timer(seconds = 125, start = TRUE)
tmr
tmr#> 00:02:05
tmr_elapsed(tmr)
#> 00:02:05.004107
tmr#> 00:02:05
tmr_elapsed(tmr)
#> 00:02:05.005799
<- tmr_stop(tmr)
tmr
tmr#> 00:02:05.00676
tmr_elapsed(tmr)
#> 00:02:05.00676
tmr_format(tmr, digits = 4)
#> [1] "00:02:05.0068"
To install the latest development version from GitHub
# install.packages("remotes")
::install_github("poissonconsulting/hmstimer") remotes
Please report any issues.
Pull requests are always welcome.
Please note that the hmstimer project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.