| timer | R Documentation |
Reporting of time elapsed since a given start time, or during the running of an expression.
timer(..., digits = 1)
... |
A date-time object of class |
digits |
integer value specifying the number of decimal places to |
The function returns a message informing of the time elapsed since the input timestamp (if it is a date-time object of class 'POSIXct'), or during the running of the input expression.
A. Marcia Barbosa
Sys.time, proc.time, difftime
# get starting time:
start <- Sys.time()
# do some random analysis:
x <- sort(rnorm(1e7))
# see how long it took:
timer(start)
# time an expression directly:
timer(x <- sort(rnorm(1e7)))
timer(x <- sort(rnorm(1e7)), digits = 2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.