Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

Timer Class Reference
[Miscellaneous Tools]

#include <lemon/time_measure.h>

Collaboration diagram for Timer:

Collaboration graph
[legend]
List of all members.

Detailed Description

Class measuring the cpu time and real time usage of the process. It is quite easy-to-use, here is a short example.
      include<lemon/time_measure.h>
      include<iostream>
     
     int main()
     {
     
       ...
     
       Timer T;
       doSomething();
       std::cout << T << '\n';
       T.reset();
       doSomethingElse();
       std::cout << T << '\n';
     
       ...
     
     }

Todo:
This shouldn't be Unix (Linux) specific.
Author:
Alpar Juttner

Definition at line 167 of file time_measure.h.

Public Member Functions

 Timer ()
 Constructor. It starts with zero time counters.
 operator TimeStamp () const
 Computes the ellapsed time.
void reset ()
 Resets the time counters.
double getUserTime () const
 Gives back the ellapsed user time of the process.
double getSystemTime () const
 Gives back the ellapsed system time of the process.
double getCUserTime () const
 Gives back the ellapsed user time of the process' children.
double getCSystemTime () const
 Gives back the ellapsed user time of the process' children.
double getRealTime () const
 Gives back the ellapsed real time of the process.


Member Function Documentation

operator TimeStamp  )  const [inline]
 

This conversion computes the ellapsed time since the construction of t or since the last t.reset().

Definition at line 182 of file time_measure.h.

Here is the call graph for this function:

void reset  )  [inline]
 

Resets the time counters

Definition at line 193 of file time_measure.h.


The documentation for this class was generated from the following file:
Generated on Mon Feb 21 15:02:36 2005 for LEMON by  doxygen 1.4.1