frepple::utils::Timer Class Reference

This class is used to measure the processor time used by the program. More...

#include <utils.h>

List of all members.

Public Member Functions

double elapsed () const
void restart ()
 Timer ()

Detailed Description

This class is used to measure the processor time used by the program.

The accuracy of the timer is dependent on the implementation of the ANSI C-function clock() by your compiler and your platform. You may count on milli-second accuracy. Different platforms provide more accurate timer functions, which can be used if the accuracy is a prime objective.
When compiled with Visual C++, the timer is returning the elapsed time - which is not the expected ANSI behavior!
Other compilers and platforms return the consumed cpu time, as expected. When the load on a machine is low, the consumed cpu-time and the elapsed time are close to each other. On a system with a higher load, the elapsed time deviates a lot from the consumed cpu-time.

Definition at line 1334 of file utils.h.


Constructor & Destructor Documentation

frepple::utils::Timer::Timer ( ) [inline, explicit]

Default constructor. Creating the timer object sets the start point for the time measurement.

Definition at line 1339 of file utils.h.


Member Function Documentation

double frepple::utils::Timer::elapsed ( ) const [inline]

Return the cpu-time in seconds consumed since the creation or the last reset of the timer.

Definition at line 1346 of file utils.h.

void frepple::utils::Timer::restart ( ) [inline]

Reset the time counter to 0.

Definition at line 1342 of file utils.h.


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

Documentation generated for frePPLe by  doxygen