R/ceiling.R

Defines functions tmr_ceiling

Documented in tmr_ceiling

#' Ceiling hms Timer
#'
#' Rounds a [hms_timer()] up to the nearest second.
#'
#' @inheritParams params
#' @return A [hms_timer()].
#' @family round
#' @export
#' @examples
#' tmr_ceiling(tmr_timer(18.9))
#' tmr_ceiling(tmr_timer(122.1))
tmr_ceiling <- function(x) {
  start <- tmr_is_started(x)
  x <- ceiling(as.numeric(tmr_elapsed(x)))
  tmr_timer(x, start = 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.