R/timer.R

Defines functions tmr_timer

Documented in tmr_timer

#' Create hms Timer
#'
#' Creates a [hms_timer()].
#' @inheritParams params
#' @return A [hms_timer()].
#' @family start_stop
#' @export
#'
#' @examples
#' tmr <- tmr_timer()
#' print(tmr)
#' class(tmr)
tmr_timer <- function(seconds = 0, start = FALSE) {
  chk_seconds(seconds)
  chk_start(start)

  seconds <- as.double(seconds)

  x <- as_hms(seconds)
  if (start) x <- tmr_start(x)
  x
}

Try the hmstimer package in your browser

Any scripts or data that you put into this service are public.

hmstimer documentation built on Sept. 20, 2022, 9:11 a.m.