powered by
This function can be used to evaluate an expression line-by-line to capture outputs, errors, messages, and evaluation time.
simpleTimeReport(title = NULL, expr, envir = parent.frame())
A reported_results/list object containing results, outputs, messages, warnings, and errors
reported_results
list
The title to be printed
The expression to run
The environment from which to evaluate the expr
expr
Evaluate code and report on the time difference
simpleTimeReport("example", { print("1") Sys.sleep(1) warning("this is a warning") for (i in 1:5) { Sys.sleep(0.5) } sample(1e6, 1e6, TRUE) })
Run the code above in your browser using DataLab