EvolvingObjects
eoTimer Class Reference

Timer allowing to measure time between a start point and a stop point. More...

#include <eoTimer.h>

List of all members.

Public Member Functions

 eoTimer ()
 Default ctor.
void restart ()
 Restarts all the timers and launch the measure.
long int usertime ()
 Measures the user time spent since the last restart().
long int systime ()
 Measures the system time spent since the last restart().
double wallclock ()
 Measures the wallclock time spent since the last restart().

Protected Attributes

struct rusage _start
long int uuremainder
long int usremainder
time_t wc_start

Detailed Description

Timer allowing to measure time between a start point and a stop point.

This timer allows the user to measure user time, system time and wallclock time between two points. Basically, user time is time spent in developer code ; system time is time spent during the IO wait and system calls ; wallclock is the difference of time we could observe by measuring time with a watch.

Definition at line 50 of file eoTimer.h.


Constructor & Destructor Documentation

eoTimer::eoTimer ( ) [inline]

Default ctor.

Begins all the timers.

Definition at line 57 of file eoTimer.h.

References restart().


Member Function Documentation

long int eoTimer::usertime ( ) [inline]

Measures the user time spent since the last restart().

If the number of elapsed seconds is zero, the spent milliseconds are added to a remainder. If the remainder exceeds one second, it is added to the number of elapsed seconds.

Returns:
Number of seconds elapsed in user space.

Definition at line 82 of file eoTimer.h.

Referenced by eoTimerStat::stop().

long int eoTimer::systime ( ) [inline]

Measures the system time spent since the last restart().

If the number of elapsed seconds is zero, the spent milliseconds are added to a remainder. If the remainder exceeds one second, it is added to the number of elapsed seconds.

Returns:
Number of seconds elapsed in system (kernel) space.

Definition at line 115 of file eoTimer.h.

Referenced by eoTimerStat::stop().

double eoTimer::wallclock ( ) [inline]

Measures the wallclock time spent since the last restart().

Returns:
Number of seconds elapsed, as a double.

Definition at line 144 of file eoTimer.h.

Referenced by eoTimerStat::stop().


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Friends