stopwatch Class Reference

stopwatch : encapsulates timing routines More...

#include <stopwatch.h>

List of all members.

Public Member Functions

 stopwatch ()
 Constructor.
void start ()
 Start the stopwatch.
double time ()
 Get the current time of the stopwatch.
double stop ()
 Stop the stopwatch, get the time.


Detailed Description

stopwatch : encapsulates timing routines

This class encapsulates the system's timing functions. I've found that Mac and Linux use very different versions of time.h, and with different clock resolutions. Rather than deal with it in the silly C-style (this is C++ after all), I created a simple stopwatch class.


Constructor & Destructor Documentation

stopwatch::stopwatch (  )  [inline]

Constructor.


Member Function Documentation

void stopwatch::start (  ) 

Start the stopwatch.

Start the timing of the stopwatch, just records the current WALL TIME. This does not measure anything but the wall time. Not system time, not clock cycles just the wall time.

double stopwatch::stop (  ) 

Stop the stopwatch, get the time.

This returns the stopwatch's current time and does stop it. Returns the time in seconds as a double

double stopwatch::time (  ) 

Get the current time of the stopwatch.

This returns the stopwatch's current time without stopping it. Returns the time in seconds as a double


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

Generated on Fri Nov 20 18:09:06 2009 for OpenGLot by  doxygen 1.5.8