Nazara Engine  0.4
A fast, complete, cross-platform API designed for game development
Nz::Clock Class Reference

Utility class that measure the elapsed time. More...

Public Member Functions

 Clock (UInt64 startingValue=0, bool paused=false)
 Constructs a Clock object. More...
 
 Clock (const Clock &clock)=default
 
 Clock (Clock &&clock)=default
 
float GetSeconds () const
 
UInt64 GetMicroseconds () const
 
UInt64 GetMilliseconds () const
 
bool IsPaused () const
 
void Pause ()
 Pause the clock. More...
 
void Restart ()
 Restart the clock Restarts the clock, putting it's time counter back to zero (as if the clock got constructed).
 
void Unpause ()
 Unpause the clock. More...
 
Clockoperator= (const Clock &clock)=default
 
Clockoperator= (Clock &&clock)=default
 

Detailed Description

Utility class that measure the elapsed time.

Constructor & Destructor Documentation

◆ Clock()

Nz::Clock::Clock ( UInt64  startingValue = 0,
bool  paused = false 
)

Constructs a Clock object.

Parameters
startingValueThe starting time value, in microseconds
pausedThe clock pause state

Member Function Documentation

◆ GetMicroseconds()

UInt64 Nz::Clock::GetMicroseconds ( ) const

Returns the elapsed time in microseconds

Returns
Microseconds elapsed
See also
GetMilliseconds, GetSeconds

◆ GetMilliseconds()

UInt64 Nz::Clock::GetMilliseconds ( ) const

Returns the elapsed time in milliseconds

Returns
Milliseconds elapsed
See also
GetMicroseconds, GetSeconds

◆ GetSeconds()

float Nz::Clock::GetSeconds ( ) const

Returns the elapsed time in seconds

Returns
Seconds elapsed
See also
GetMicroseconds, GetMilliseconds

◆ IsPaused()

bool Nz::Clock::IsPaused ( ) const

Returns the current pause state of the clock

Returns
Boolean indicating if the clock is currently paused
See also
Pause, Unpause

◆ Pause()

void Nz::Clock::Pause ( )

Pause the clock.

Pauses the clock, making the time retrieving functions to always return the value at the time the clock was paused This has no effect if the clock is already paused

See also
IsPaused, Unpause

◆ Unpause()

void Nz::Clock::Unpause ( )

Unpause the clock.

Unpauses the clock, making the clock continue to measure the time This has no effect if the clock is already unpaused

See also
IsPaused, Unpause

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