Utility class for manipulating time. More...
#include <Clock.hpp>
Public Member Functions | |
Clock () | |
Default constructor. | |
Uint32 | GetElapsedTime () const |
Get the time elapsed. | |
void | Reset () |
Restart the timer. |
Utility class for manipulating time.
sf::Clock is a lightweight class for measuring time.
Its resolution depends on the underlying OS, but you can generally expect a 1 ms resolution.
Usage example:
sf::Clock clock; ... Uint32 time1 = clock.GetElapsedTime(); clock.Reset(); ... Uint32 time2 = clock.GetElapsedTime();
Definition at line 40 of file Clock.hpp.
sf::Clock::Clock | ( | ) |
Default constructor.
The clock starts automatically after being constructed.
Uint32 sf::Clock::GetElapsedTime | ( | ) | const |
void sf::Clock::Reset | ( | ) |
Restart the timer.
This function puts the time counter back to zero.