mimas::timer Class Reference

Class for measuring time. More...

#include <timer.h>

Collaboration diagram for mimas::timer:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 timer (void)
 Constructor starting timer.
void reset (void)
 Restart timer.
double elapsed (std::string unit="s") const
 Get elapsed time.

Protected Attributes

timeval time
 Time of construction of this object.

Detailed Description

Class for measuring time.

Definition at line 13 of file timer.h.


Constructor & Destructor Documentation

mimas::timer::timer ( void   )  [inline]

Constructor starting timer.

The constructor will call reset() to.

Definition at line 18 of file timer.h.

References reset().

Here is the call graph for this function:


Member Function Documentation

void mimas::timer::reset ( void   )  [inline]

Restart timer.

Reset the time elapsed to zero again.

Definition at line 21 of file timer.h.

References time.

Referenced by timer().

double mimas::timer::elapsed ( std::string  unit = "s"  )  const

Get elapsed time.

The time elapsed (in seconds) is returned. The unit can be specified using "s" for second, "ms" for milli-second and "mms" for micro-second

Returns:
Time elapsed since last call of timer or reset() .


Member Data Documentation

struct timeval mimas::timer::time [protected]

Time of construction of this object.

Definition at line 36 of file timer.h.

Referenced by reset().


The documentation for this class was generated from the following file:
[GNU/Linux] [Qt] [Mesa] [STL] [Lapack] [Boost] [Magick++] [Xalan-C and Xerces-C] [doxygen] [graphviz] [FFTW] [popt] [xine] [Gnuplot] [gnu-arch] [gcc] [gstreamer] [autoconf/automake/make] [freshmeat.net] [opensource.org] [sourceforge.net] [MMVL]
mimas 2.1 - Copyright Mon Oct 30 11:31:48 2006, Bala Amavasai, Stuart Meikle, Arul Selvan, Fabio Caparrelli, Jan Wedekind, Manuel Boissenin, ...