R/is-started.R

Defines functions tmr_is_started

Documented in tmr_is_started

#' Is hms Timer Started
#'
#' Tests if a [hms_timer()] is started (as indicated by the
#' presence of an attribute named start).
#' @inheritParams params
#' @return A flag (TRUE or FALSE).
#' @family start_stop
#' @export
#' @examples
#' tmr <- tmr_timer(start = TRUE)
#' print(tmr_is_started(tmr))
#' tmr <- tmr_stop(tmr)
#' print(tmr_is_started(tmr))
tmr_is_started <- function(x) {
  chk_x(x)
  !is.null(attr(x, "start"))
}

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.