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.c'. The interface contains the following external definitions and macros:

Type `ticker_t'

describes a timer. Knowledge of structure (implementation) of this type is not needed for using timer.

Function `create_ticker'

          `ticker_t create_ticker (void)'
returns new timer. The state of the timer is active. This function call must to be the first for given timer.

Function `ticker_off'

          `void ticker_off (ticker_t *ticker)'
stops the timer given as the first parameter.

Function `ticker_on'

          `void ticker_on (ticker_t *ticker)'
activates the timer given as the first parameter.

Public function `active_time'

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

Public function `active_time_string'

          `const char *active_time_string (void)'
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