timer: Timer

View source: R/timer.R

timerR Documentation

Timer

Description

Reporting of time elapsed since a given start time, or during the running of an expression.

Usage

timer(start.time, digits = 1)

Arguments

start.time

A date-time object of class POSIXct, e.g. as given by Sys.time; or an expression to be timed.

digits

integer value specifying the number of decimal places to round the output to.

Value

The function returns a message informing of the time elapsed since the input 'start.time', or during the running of the input expression.

Author(s)

A. Marcia Barbosa

See Also

Sys.time, proc.time, difftime

Examples

# get starting time:
start <- Sys.time()

# do some random analysis:
x <- sort(rnorm(3e7))

# see how long it took:
timer(start)


# time an expression directly:
timer(x <- sort(rnorm(3e7)))
timer(x <- sort(rnorm(3e7)), digits = 2)

fuzzySim documentation built on Oct. 3, 2025, 3 p.m.