Public Member Functions
sf::Clock Class Reference

Utility class for manipulating time. More...

#include <Clock.hpp>

List of all members.

Public Member Functions

 Clock ()
 Default constructor.
Uint32 GetElapsedTime () const
 Get the time elapsed.
void Reset ()
 Restart the timer.

Detailed Description

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.


Constructor & Destructor Documentation

sf::Clock::Clock ( )

Default constructor.

The clock starts automatically after being constructed.


Member Function Documentation

Uint32 sf::Clock::GetElapsedTime ( ) const

Get the time elapsed.

This function returns the time elapsed since the last call to Reset() (or the construction of the instance if Reset() has not been called).

Returns:
Time elapsed, in milliseconds
void sf::Clock::Reset ( )

Restart the timer.

This function puts the time counter back to zero.


The documentation for this class was generated from the following file: