Timed {xegaSelectGene}R 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")

[Package xegaSelectGene version 1.0.0.0 Index]