Timer Class Reference

Simple wrapper around the gettimeofday system call for measuring wall clock time of events. More...

#include <Timer.h>

List of all members.

Public Member Functions

 Timer ()
 Default constructor.
 Timer (const Timer &rhs)
 Copy constructor.
Timeroperator= (const Timer &rhs)
 Assignment operator.
void start ()
 Start the timer.
void stop ()
 Stop the timer.
void reset ()
 Reset both the start and stop times to zero.
double getDiffMicroseconds ()
 Get the difference between the start and stop times in microseconds.
double getDiffMilliseconds ()
 Get the difference between the start and stop times in milliseconds.
double getDiffSeconds ()
 Get the difference between the start and stop times in seconds.
void swap ()
 Swap the starting time and ending time of this Timer.
time_t getLastStopped ()

Private Attributes

timeval startTime_
 The time this timer was started.
timeval endTime_
 The time this timer was stopped.


Detailed Description

Simple wrapper around the gettimeofday system call for measuring wall clock time of events.


Constructor & Destructor Documentation

Timer::Timer  ) 
 

Default constructor.

Creates a Timer object with a start and end time of zero


Member Function Documentation

double Timer::getDiffMicroseconds  ) 
 

Get the difference between the start and stop times in microseconds.

Returns:
The number of microseconds that elapsed between starting and stopping this timer

double Timer::getDiffMilliseconds  ) 
 

Get the difference between the start and stop times in milliseconds.

Returns:
The number of milliseconds that elapsed between starting and stopping this timer

double Timer::getDiffSeconds  ) 
 

Get the difference between the start and stop times in seconds.

Returns:
The number of seconds that elapsed between starting and stopping this timer

time_t Timer::getLastStopped  )  [inline]
 

Returns:
The number of seconds since epoch when this timer was last stopped


The documentation for this class was generated from the following files:
Generated on Wed Mar 8 14:43:33 2006 for Fountain by  doxygen 1.4.6