Next Previous Contents

12. Ticker package

The package `ticker' implements a timer. Timer can be activated or can be stopped. The timer accumulates execution time only when it is in active state. The interface part of the package is file `ticker.h'. The implementation part is file `ticker.cpp'. The interface contains the following external definitions and macros:

Type `ticker_t'

describes a timer. This type is simply synonym of `class ticker'.

Class `ticker'

Timers are objects of this class. The class has the following members:

Public constructor `ticker'

             `ticker (void)'
             
creates new timer. The state of the timer is active.

Public function `ticker_off'

             `void ticker_off (void)'
             
stops given timer.

Public function `ticker_on'

             `void ticker_on (void)'
             
activates given timer.

Function `active_time'

             `double active_time (ticker_t ticker)'
             
returns time in seconds as double float value in which the timer given as the function parameter was active.

Function `active_time_string'

             `const char *active_time_string (ticker_t ticker)'
             
returns string representation of time in seconds in which the timer given as the function parameter was active. Remember that this function must be the single in a C++ expression because the string is stored in a static variable of the function.


Next Previous Contents