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"))
}
poissonconsulting/hmstimer documentation built on Nov. 20, 2024, 10:02 p.m.