Timed: Transformation into a timed function

View source: R/timer.R

TimedR Documentation

Transformation into a timed function

Description

Timed() takes two functions as arguments, namely the function whose time and call frequency should be measured and a timer object created by newTimer(). It returns a timed function.

Usage

Timed(FUN, timer)

Arguments

FUN

A function whose run time should be measured.

timer

A timer generated by newTimer().

Value

A timed function.

See Also

Other Performance Measurement: Counted(), newCounter(), newTimer()

Examples

    test<-function(seconds) {Sys.sleep(seconds)} 
    testTimer<-newTimer()
    testTimed<-Timed(test, testTimer)
    testTimer("Count"); testTimer("TimeUsed")
    testTimed(1); testTimed(2)
    testTimer("Count") 
    testTimer("TimeUsed")

xegaSelectGene documentation built on April 16, 2025, 5:12 p.m.