Learn R Programming

SciViews (version 0.9-13.1)

timing: Timing of R expressions.

Description

Similar to system.time() but returns a more convenient 'difftime' object.

Usage

timing(expr, gc.first = TRUE)

Arguments

expr

Valid R expression to be timed. If missing, proc.time() is used instead.

gc.first

Logical - should a garbage collection be performed immediately before the timing? Default is TRUE.

See Also

system.time()

Examples

Run this code
# NOT RUN {
test <- timing(Sys.sleep(0.5))
test
attr(test, "details")
# }

Run the code above in your browser using DataLab