genFunTimer | R Documentation |
trace
This function arranges to monitor
all calls (direct or indirect) to the specified function
and measures the time each call took and stores that value
which can be accessed at any time via the return value of this
function.
This use trace
to run the
timing code at the start and end of each call to the function.
To stop collecting the timings for the function,
untrace
it.
timeFun(fun, tmr = genFunTimer(), where = globalenv(), ...)
fun |
the function or name of the function to trace |
tmr |
the list of functions closure whose |
where |
passed to |
... |
passed to |
A list with three elements, allfunctions.
start |
use with trace to |
Duncan Temple Lang
trace
tmr = timeFun(model.matrix)
lm(mpg ~ . , mtcars)
tmr$times()
invisible(replicate(10, lm(mpg ~ . , mtcars)))
tmr$times()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.