hmstimer

Lifecycle: maturing R 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::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.005813
tmr
#> 00:02:05
tmr_elapsed(tmr)
#> 00:02:05.010475

tmr <- tmr_stop(tmr)

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

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

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.