starttime: Start a timer and report the elapsed time

Description Usage Arguments Details Value Functions Examples

Description

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.

Usage

1
2
3
starttime()

elapsedtime(script_end = TRUE)

Arguments

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.

Details

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.

Value

No value returned for starttime(). The elapsed time is returned using elapsedtime().

Functions

Examples

1
2
3

jeanmarcgp/xtsanalytics documentation built on May 19, 2019, 12:38 a.m.