Description Usage Arguments Details Value Functions Examples
These two functions, 'starttime()' and 'elapsedtime()' work together. Call starttime() at the beginning of a script without any argument. This logs the current time in global variable '.__start.time'. Then at the end of the script or whenever a report of the elapsed time interval is desired, call elapsed.time() to print the elapsed time on the console.
1 2 3 | starttime()
elapsedtime(script_end = TRUE)
|
script_end |
Logical. Default value TRUE. Only relevant for elapsedtime(). If TRUE, an end of script message is printed on the console in addition to the elapsed time. If FALSE, only the elapsed time is reported. |
NOTE: The reference to global variable '.__start.time' should be changed to using the package NAMESPACE, since this provides the side effect of creating a global variable. But for now, this works fine, so this is a future improvement.
No value returned for starttime(). The elapsed time is returned using elapsedtime().
elapsedtime
: Report the elapsed time since starttime() was last invoked.
1 2 3 | starttime()
Sys.sleep(0.5)
zzz <- elapsedtime()
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.