#include <cowtimer.h>
Inheritance diagram for ABA_COWTIMER:
Public Member Functions | |
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. | |
ABA_COWTIMER (ABA_GLOBAL *glob, long secs) | |
virtual | ~ABA_COWTIMER () |
Private Member Functions | |
virtual long | theTime () const |
Returns the wall clock time since the initialization of the timer in ![]() | |
Private Attributes | |
long | baseTime_ |
Stores the result of a call to the function time(NULL) at construction time. |
Definition at line 37 of file cowtimer.h.
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 seconds without arithmetic overflow. The function time() is defined in the standard /-library.
glob | A pointer to a global object. |
ABA_COWTIMER::ABA_COWTIMER | ( | ABA_GLOBAL * | glob, | |
long | secs | |||
) |
This constructor initializes the total time of the timer.
The timer is not running, too.
glob | A pointer to a global object. | |
centiSeconds | The initial value of the timer in ![]() |
virtual ABA_COWTIMER::~ABA_COWTIMER | ( | ) | [virtual] |
The destructor.
virtual long ABA_COWTIMER::theTime | ( | ) | const [private, virtual] |
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.