Pausable clock class that measures elapsed time. More...
Public Member Functions | |
StopWatch (bool initiallyRunning=false) | |
Constructor: Sets up a new StopWatch with time zero. | |
float | GetElapsedTime () const |
Returns the totally elapsed time. | |
bool | IsRunning () const |
Checks if the stopwatch is currently running. | |
void | Start () |
Starts or continues the stopwatch. | |
void | Stop () |
Pauses the stopwatch. | |
void | Reset (bool continueRunning=false) |
Resets the stopwatch's time to zero. |
Pausable clock class that measures elapsed time.
Unlike sf::Clock, this clock can be paused and continued at any time.
thor::StopWatch::StopWatch | ( | bool | initiallyRunning = false | ) | [explicit] |
Constructor: Sets up a new StopWatch with time zero.
initiallyRunning | Specifies whether the stopwatch immediately starts. |
void thor::StopWatch::Reset | ( | bool | continueRunning = false | ) |
Resets the stopwatch's time to zero.
continueRunning | Declares if the stopwatch is running further or waiting for the next Start() call. |
void thor::StopWatch::Start | ( | ) |
Starts or continues the stopwatch.
If it is already running, nothing happens.
void thor::StopWatch::Stop | ( | ) |
Pauses the stopwatch.
If it is already paused, nothing happens.