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
src
util
Timer.cpp
Go to the documentation of this file.
1
#include "
./asw/util/Timer.h
"
2
3
// Start Timer
4
void
Timer::start
() {
5
t1
= std::chrono::high_resolution_clock::now();
6
t2
= std::chrono::high_resolution_clock::now();
7
running
=
true
;
8
}
9
10
// Stop
11
void
Timer::stop
() {
12
running
=
false
;
13
t2
= std::chrono::high_resolution_clock::now();
14
}
15
16
// Is running
17
bool
Timer::isRunning
()
const
{
18
return
running
;
19
}
20
21
// Reset
22
void
Timer::reset
() {
23
t1
= std::chrono::high_resolution_clock::now();
24
t2
= std::chrono::high_resolution_clock::now();
25
}
Timer.h
Timer::start
void start()
Definition
Timer.cpp:4
Timer::running
bool running
Definition
Timer.h:50
Timer::t1
std::chrono::time_point< std::chrono::high_resolution_clock > t1
Definition
Timer.h:46
Timer::isRunning
bool isRunning() const
Definition
Timer.cpp:17
Timer::stop
void stop()
Definition
Timer.cpp:11
Timer::reset
void reset()
Definition
Timer.cpp:22
Timer::t2
std::chrono::time_point< std::chrono::high_resolution_clock > t2
Definition
Timer.h:48
Generated by
1.12.0