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
3
namespace
Sleak
{
4
Timer::Timer
() {
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
};
Timer.hpp
Sleak::Timer::Timer
Timer()
Definition
Timer.cpp:4
Sleak::Timer::Reset
void Reset()
Restarts the clock at zero.
Definition
Timer.cpp:8
Sleak::Timer::Elapsed
float Elapsed() const
Seconds since construction or the last Reset().
Definition
Timer.cpp:13
Sleak
Root namespace for everything the engine exposes.
Definition
Camera.hpp:10
src
Core
Timer.cpp
Generated on
for SleakEngine by
1.16.1