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. More...

#include <cowtimer.h>

Inheritance diagram for ABA_COWTIMER:

ABA_TIMER ABA_ABACUSROOT List of all members.

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 $1\over100$ seconds.

Private Attributes

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

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.


Constructor & Destructor Documentation

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\over100$ seconds without arithmetic overflow. The function time() is defined in the standard /-library.

Parameters:
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.

Parameters:
glob A pointer to a global object.
centiSeconds The initial value of the timer in $1\over100$ seconds.

virtual ABA_COWTIMER::~ABA_COWTIMER (  )  [virtual]

The destructor.


Member Function Documentation

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

Returns the wall clock time since the initialization of the timer in $1\over100$ 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.


Member Data Documentation

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:
Generated on Tue Aug 14 18:09:56 2007 for ABACUS by  doxygen 1.5.1