newCounter {xegaSelectGene}R Documentation

Counter

Description

newCounter sets up a counter object with one internal state variable, namely count to count the number of counter calls.

Usage

newCounter()

Details

Generate a counter: a<-newCounter() sets up the counter a. The counter a supports three methods:

  1. a() or a("Measure") or a(method="Measure") starts the timer when called 1st, 3rd, 5th, ... time and stops the timer when called the 2nd, 4th, 6th, ... time. The calls can be manually inserted before and after a block of R-code for profiling.

  2. a("Count") or a(method="Count") returns the number of times the function/block or R-code has been executed.

Value

newCounter() returns a counter function.

a_counter_function() returns the number of times it has been called (invisible).

a_counter_function("Show") returns the number of executions of the a_counter_function.

See Also

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

Examples

   a<-newCounter() 
   a(); a()
   a("Show")

[Package xegaSelectGene version 1.0.0.0 Index]