Wrap a function with a timer.
time_it(func, units = "auto", digits = 2)
Arguments
- func
(function) A function to decorate.
- units
(character) Units in which the results are desired, including:
"auto", "secs", "mins", "hours", "days",
and "weeks". See difftime.
- digits
(integer) The number of significant digits to be used. See
signif.
Value
(closure) An object that contains the original function bound to the environment of the decorator.