SleakEngine 1.0.0
C++23 multi-backend game engine
Loading...
Searching...
No Matches
Timer.cpp
Go to the documentation of this file.
1#include <Core/Timer.hpp>
2
3namespace Sleak {
5 Reset();
6 }
7
8 void Timer::Reset() {
9 startPoint = std::chrono::high_resolution_clock::now();
10 }
11
12 // Outputs elaosed time as seconds
13 float Timer::Elapsed() const {
14 auto now = std::chrono::high_resolution_clock::now();
15 std::chrono::duration<float> elapsed = now - startPoint;
16 return elapsed.count();
17 }
18};
void Reset()
Restarts the clock at zero.
Definition Timer.cpp:8
float Elapsed() const
Seconds since construction or the last Reset().
Definition Timer.cpp:13
Root namespace for everything the engine exposes.
Definition Camera.hpp:10