17#ifndef _FGE_C_CLOCK_HPP_INCLUDED
18#define _FGE_C_CLOCK_HPP_INCLUDED
41 g_lastTimePoint(std::chrono::steady_clock::now())
49 auto getElapsedTime()
const {
return std::chrono::steady_clock::now() - this->g_lastTimePoint; }
60 return std::chrono::duration_cast<TD>(std::chrono::steady_clock::now() - this->g_lastTimePoint).count();
72 auto lastDuration = std::chrono::steady_clock::now() - this->g_lastTimePoint;
73 this->g_lastTimePoint = std::chrono::steady_clock::now();
89 std::chrono::duration_cast<TD>(std::chrono::steady_clock::now() - this->g_lastTimePoint).count();
90 this->g_lastTimePoint = std::chrono::steady_clock::now();
100 bool reached(std::chrono::milliseconds
const& duration)
102 return std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::steady_clock::now() -
103 this->g_lastTimePoint) >= duration;
107 std::chrono::steady_clock::time_point g_lastTimePoint;
A clock that can be used to measure time.
Definition C_clock.hpp:33
auto restart()
Restart the clock and return the time elapsed since the last time point with duration cast to the giv...
Definition C_clock.hpp:86
auto restart()
Restart the clock and return the time elapsed since the last time point.
Definition C_clock.hpp:70
bool reached(std::chrono::milliseconds const &duration)
Check if the clock has elapsed the given duration.
Definition C_clock.hpp:100
auto getElapsedTime() const
Get the time elapsed since the last time point with duration cast to the given type.
Definition C_clock.hpp:58
Clock()
Default constructor.
Definition C_clock.hpp:40
auto getElapsedTime() const
Get the time elapsed since the last time point.
Definition C_clock.hpp:49