Time {time}R Documentation

Time Tracking Functions

Description

getTime turns the output of date into an "integer" vector of length 3, timeElapsed determines the difference between two such times, and timeChar reports a time in a nice way. timeReport is a macro for the latter two.

Usage

old <- getTime()
timeElapsed( old, new = getTime() )
timeChar( time = getTime() )
timeReport(time)

Arguments

old "integer" vector of length 3 that specifies hours, minutes, and seconds, respectively.
new "integer" vector of length 3 that specifies hours, minutes, and seconds, respectively.
time "integer" vector of length 3 that specifies hours, minutes, and seconds, respectively.

Value

"integer" vector of length 3 that specifies hours, minutes, and seconds, respectively.

Note

It is usually nice to provide the user a verbose option that he may choose to set to FALSE if no output from time tracking functions is desired. Also, a known bug is that timeElapsed considers 24 to be the maximal number of hours in the day, and thus if it is called after midnight for a calculation started the day before, an incorrect difference will be calculated.

Author(s)

Toby Dylan Hocking <tobob@berkeley.edu>

Examples

time <- getTime()
#TimeConsumingAnalysisTask
timeReport(time)

[Package time version 1.0 Index]