Counted {xegaSelectGene}R Documentation

Transformation into a counted function

Description

Counted takes two functions as arguments: The function whose call frequency should be measured and a counter object created by newCounter(). It returns a counted function.

Usage

Counted(FUN, counter)

Arguments

FUN

A function whose run time should be measured.

counter

A counter generated by newCounter().

Value

A counted function.

See Also

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

Examples

    test<-function(v) {sum(v)} 
    testCounter<-newCounter()
    testCounted<-Counted(test, testCounter)
    testCounter("Show")
    testCounted(sample(10,10)); testCounted(sample(10,10))
    testCounter("Show")

[Package xegaSelectGene version 1.0.0.0 Index]