6.70 ABA_COWTIMER Class Reference

class derived from ABA_TIMER implements a timer measuring the elpased time (clock-of-the-wall time) of parts of the program.

#include <cowtimer.h>

Inheritance diagram for ABA_COWTIMER::


PIC


Public Member Functions

Private Member Functions

Private Attributes

6.70.1 Detailed Description

class derived from ABA_TIMER implements a timer measuring the elpased time (clock-of-the-wall time) of parts of the program.

Definition at line 37 of file cowtimer.h.

6.70.2 Constructor & Destructor Documentation

6.70.2.1 ABA_COWTIMER::ABA_COWTIMER (ABA_GLOBAL * glob)

After the application of the constructor the timer is not running, i.e., to measure time it has to be started explicitly.

We initialize base time with the current time, such that later we can convert the time to 1 _ 100 seconds without arithmetic overflow. The function time() is defined in the standard /-library.

Parameters:

glob
A pointer to a global object.

6.70.2.2 ABA_COWTIMER::ABA_COWTIMER (ABA_GLOBAL * glob, long secs)

This constructor initializes the total time of the timer.

The timer is not running, too.

Parameters:

glob
A pointer to a global object.
centiSeconds
The initial value of the timer in 1 _ 100 seconds.

6.70.2.3 virtual ABA_COWTIMER::~ABA_COWTIMER () [virtual]

The destructor.

6.70.3 Member Function Documentation

6.70.3.1 virtual long ABA_COWTIMER::theTime () const [private, virtual]

Returns the wall clock time since the initialization of the timer in 1 _ 100 seconds.

This function redefines the pure virtual function of the base class ABA_TIMER.

The function theTime() uses the function times(), which returns the elapsed real time in clock ticks.

Implements ABA_TIMER.

6.70.4 Member Data Documentation

6.70.4.1 long ABA_COWTIMER::baseTime_ [private]

Stores the result of a call to the function time(NULL) at construction time.

We require this member such that we can return the time in centiseconds correctly in the function theTime(). Otherwise, an arithmetic overflow can occur.

Definition at line 85 of file cowtimer.h.

The documentation for this class was generated from the following file: