powered by
Time an Expression and Report in Quarto Margin
timeMar(x)
invisibly, the result of the expression
an expression to execute
Frank Harrell
Function to time an expression, printing the result of base::system.time() in the right margin, and storing the result of system.time in .systime. in the global environment so tha the user can refer to it.
base::system.time()
.systime.
hooktime()
if (FALSE) { g <- function(...){} # define a function to run slowly result <- timeMar(g()) }
Run the code above in your browser using DataLab