timing: Easy function and evalutation timing

Description Usage Arguments Value Author(s) Examples

Description

Times a function or evaulation and appends the timing results as an attribute to the object.

Usage

1
timing(expr)

Arguments

expr

A valid R expression or function call.

Value

Returns the result of the evaluated expr with an attribute called "timing" containing the evaulation time.

Author(s)

Anders Ellern Bilgrau <anders.ellern.bilgrau (at) gmail.com>

Examples

1
2
3
4
5
6
test <- function() mean(rnorm(1e6))
a <- timing(test())
print(a)

b <- timing(mean(rnorm(1e6)))
print(b)

AEBilgrau/Bmisc documentation built on May 5, 2019, 11:28 a.m.