R/report_time.R

Defines functions report_time

report_time <- function(t1,
                        t2=NULL,
                        prefix="Done in:"){
  if(is.null(t2)) t2 <- Sys.time()
  out <- as.numeric(round(difftime(t2,t1,units = "m"),2))
  cat(
    cli::col_br_cyan(paste(
      prefix,cli::col_br_white(out," min")
    ),"\n"
    )
  )
}
RajLabMSSM/echolocatoR documentation built on Jan. 29, 2023, 6:04 a.m.