e2d::core::SimpleTimer Class Reference

List of all members.

Detailed Description

This is a simple implementation of an all-purpose timer. It just keeps the last time and checks if the set interval has elapsed, updating the last time with the actual time. It doesn't spend any cpu time because it just checks if the interval has elapsed when you explictly call HasElapsed() method.

Public Member Functions

 SimpleTimer (unsigned int interval)
unsigned int GetInterval ()
 Gets the previously set interval.
bool HasElapsed ()
 Checks if the interval has elapsed.
void Reset ()
 Resets the counter.
void SetInterval (unsigned int interval)
 Sets the interval.

Constructor & Destructor Documentation

e2d::core::SimpleTimer::SimpleTimer ( unsigned int  interval  ) 

You can set the interval with this constructor. If you use the default constructor instead of this one, the interval will be set to 1000 (1 second).

interval Time in milisseconds.

Member Function Documentation

unsigned int e2d::core::SimpleTimer::GetInterval (  ) 

interval in milisseconds.

bool e2d::core::SimpleTimer::HasElapsed (  ) 

true if elapsed, false otherwise.

void e2d::core::SimpleTimer::Reset (  ) 

Resets the counter.

void e2d::core::SimpleTimer::SetInterval ( unsigned int  interval  ) 

Set the interval to check

interval Time in milisseconds.

Generated on Tue Dec 8 10:32:44 2009 for Easy2D by  doxygen 1.5.6