R/report_time.R

Defines functions report_time

Documented in report_time

#' Report time at end of function
#'
#' @keywords internal
#' @importFrom utils capture.output
report_time <- function(start,
                        v = TRUE, 
                        return_time = FALSE) {
    elapsed <- difftime(Sys.time(), start)
    messager(
        utils::capture.output(round(elapsed, 1)),
        v = v
    )
    if(return_time) return(elapsed)
}
RajLabMSSM/echotabix documentation built on Nov. 21, 2023, 8:02 a.m.