hmstimer

Lifecycle: maturing Travis build status AppVeyor build status Codecov test coverage License: MIT tinyverse status CRAN status CRAN downloads

hmstimer is an R package to track elapsed clock time using a hms() scalar (inherits from difftime() with seconds as the unit).

library(hmstimer)

t <- tmr_timer()

tmr_elapsed(t)
#> Time difference of 0 secs

library(hms) # for prettier printing load hms

tmr_elapsed(t)
#> 00:00:00

t <- tmr_start(t)

tmr_elapsed(t)
#> 00:00:00.000857
tmr_elapsed(t)
#> 00:00:00.002076
t <- tmr_stop(t)

# time elapsed is now fixed
tmr_elapsed(t)
#> 00:00:00.003408
tmr_elapsed(t)
#> 00:00:00.003408

# the timer can be restarted
t <- tmr_start(t)
tmr_elapsed(t)
#> 00:00:00.004273

Installation

To install the latest release version from CRAN

install.packages("hmstimer")

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.

Please note that this project is released with a Contributor Code of Conduct. By contributing, you agree to abide by its terms.