Public Member Functions
thor::StopWatch Class Reference

Pausable clock class that measures elapsed time. More...

List of all members.

Public Member Functions

 StopWatch ()
 Constructor: Sets up a paused 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 ()
 Resets the stopwatch's elapsed time to zero and stops it.
void restart ()
 Resets the stopwatch's elapsed time to zero and starts it again.

Detailed Description

Pausable clock class that measures elapsed time.

Unlike sf::Clock, this clock can be paused and continued at any time.


Constructor & Destructor Documentation

Constructor: Sets up a paused stopwatch with time zero.

The stopwatch is initially not running. Call start() to run it.


Member Function Documentation

Resets the stopwatch's elapsed time to zero and stops it.

In contrast to restart(), the stopwatch is not running after the call.

Resets the stopwatch's elapsed time to zero and starts it again.

The behavior is equivalent to reset() followed by start().

Starts or continues the stopwatch.

If it is already running, nothing happens.

Pauses the stopwatch.

If it is already paused, nothing happens.


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