vengine  0.1.0
3D graphics engine made with Vulkan
Loading...
Searching...
No Matches
myLib::Clock Class Reference

Class for time management. More...

#include <Clock.hpp>

+ Collaboration diagram for myLib::Clock:

Public Member Functions

 Clock ()
 
 ~Clock ()=default
 
void restart ()
 Restart the clock.
 
void pause ()
 Pause the clock.
 
void resume ()
 Resume the clock.
 
Time getElapsedTime () const
 Get the elapsed time since the last restart.
 

Private Attributes

TimePoint m_start
 
TimePoint m_pause
 
bool m_paused {false}
 

Detailed Description

Class for time management.

Definition at line 23 of file Clock.hpp.

Constructor & Destructor Documentation

◆ Clock()

myLib::Clock::Clock ( )
inline

Definition at line 27 of file Clock.hpp.

◆ ~Clock()

myLib::Clock::~Clock ( )
default

Member Function Documentation

◆ getElapsedTime()

myLib::Time myLib::Clock::getElapsedTime ( ) const
nodiscard

Get the elapsed time since the last restart.

Returns
Time The elapsed time

Definition at line 22 of file clock.cpp.

◆ pause()

void myLib::Clock::pause ( )

Pause the clock.

Definition at line 3 of file clock.cpp.

References m_pause, and m_paused.

◆ restart()

void myLib::Clock::restart ( )
inline

Restart the clock.

Definition at line 34 of file Clock.hpp.

References m_start.

◆ resume()

void myLib::Clock::resume ( )

Resume the clock.

Definition at line 12 of file clock.cpp.

Member Data Documentation

◆ m_pause

TimePoint myLib::Clock::m_pause
private

Definition at line 62 of file Clock.hpp.

Referenced by pause().

◆ m_paused

bool myLib::Clock::m_paused {false}
private

Definition at line 67 of file Clock.hpp.

Referenced by pause().

◆ m_start

TimePoint myLib::Clock::m_start
private

Definition at line 57 of file Clock.hpp.

Referenced by restart().


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