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) |
| Constructor.
|
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).
- Parameters:
-
| interval | Time in milisseconds. |
Member Function Documentation
unsigned int e2d::core::SimpleTimer::GetInterval |
( |
|
) |
|
- Returns:
- interval in milisseconds.
bool e2d::core::SimpleTimer::HasElapsed |
( |
|
) |
|
- Returns:
- true if elapsed, false otherwise.
void e2d::core::SimpleTimer::Reset |
( |
|
) |
|
void e2d::core::SimpleTimer::SetInterval |
( |
unsigned int |
interval |
) |
|
Set the interval to check
- Parameters:
-
| interval | Time in milisseconds. |