ASW Lib
A.D.S. Games SDL Wrapper Library. A library targeted at Allegro4 users who want to switch to SDL3 and use modern c++.
Loading...
Searching...
No Matches
Timer.cpp
Go to the documentation of this file.
1#include "./asw/util/Timer.h"
2
3// Start Timer
5 t1 = std::chrono::high_resolution_clock::now();
6 t2 = std::chrono::high_resolution_clock::now();
7 running = true;
8}
9
10// Stop
12 running = false;
13 t2 = std::chrono::high_resolution_clock::now();
14}
15
16// Is running
17bool Timer::isRunning() const {
18 return running;
19}
20
21// Reset
23 t1 = std::chrono::high_resolution_clock::now();
24 t2 = std::chrono::high_resolution_clock::now();
25}
void start()
Definition Timer.cpp:4
bool running
Definition Timer.h:50
std::chrono::time_point< std::chrono::high_resolution_clock > t1
Definition Timer.h:46
bool isRunning() const
Definition Timer.cpp:17
void stop()
Definition Timer.cpp:11
void reset()
Definition Timer.cpp:22
std::chrono::time_point< std::chrono::high_resolution_clock > t2
Definition Timer.h:48