hmstimer

Lifecycle: stable R-CMD-check codecov License: MIT CRAN status CRAN downloads

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 <- tmr_timer(seconds = 125, start = TRUE)
tmr
#> 00:02:05
tmr_elapsed(tmr)
#> 00:02:05.004107
tmr
#> 00:02:05
tmr_elapsed(tmr)
#> 00:02:05.005799

tmr <- tmr_stop(tmr)

tmr
#> 00:02:05.00676
tmr_elapsed(tmr)
#> 00:02:05.00676

tmr_format(tmr, digits = 4)
#> [1] "00:02:05.0068"

Installation

To install the latest development version from GitHub

# install.packages("remotes")
remotes::install_github("poissonconsulting/hmstimer")

Contribution

Please report any issues.

Pull requests are always welcome.

Code of Conduct

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.