Pausable clock class that measures elapsed time. More...
Public Member Functions | |
| StopWatch (bool initiallyRunning=false) | |
| Constructor: Sets up a new StopWatch with time zero. | |
| sf::Time | 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 restart=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 | restart = false | ) |
Resets the stopwatch's time to zero.
| restart | True if the stopwatch continues to run, false if it waits 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.