#include <Timer.h>
Public Member Functions | |
virtual | ~Timer () |
Timer () | |
virtual void | StartTiming () |
virtual void | StopTiming () |
virtual bool | IsTiming () const |
virtual double | GetStartTime () const |
virtual double | GetStopTime () const |
virtual double | GetTimeDelta () const |
Static Public Member Functions | |
static double | GetCurrentTime () |
Protected Attributes | |
bool | mTiming |
double | mStartTime |
double | mStopTime |
virtual green::Timer::~Timer | ( | ) | [inline, virtual] |
Virtual destructor
green::Timer::Timer | ( | ) | [inline] |
Default constructor sets the Timer to not be timing, and startTime is set to 0.0
static double green::Timer::GetCurrentTime | ( | ) | [inline, static] |
Get the current time NOTE: This isn't really the best way to do timing. The reason is that it is based off of wall clock time, which could change while the program is running (from a time server sync or from the user setting the time) which produces undefined results (potentially negative time deltas!). However, the Timer will at least ensure that there are no negative time deltas, and return a zero time delta in the above case.
virtual void green::Timer::StartTiming | ( | ) | [inline, virtual] |
Start timing. This sets a time marker from which GetTimeDelta is based.
virtual void green::Timer::StopTiming | ( | ) | [inline, virtual] |
Stop timing. You can still call GetTimeDelta() but it will return the delta between the start time and the stop time.
virtual bool green::Timer::IsTiming | ( | ) | const [inline, virtual] |
virtual double green::Timer::GetStartTime | ( | ) | const [inline, virtual] |
Get the start time (ie time when StartTiming was called)
virtual double green::Timer::GetStopTime | ( | ) | const [inline, virtual] |
Get the stop time (ie the time when StopTiming was called)
virtual double green::Timer::GetTimeDelta | ( | ) | const [inline, virtual] |