SDL Utility
Clock.hpp
Go to the documentation of this file.
1 /*****************************************************************/
9 #pragma once
10 
11 #include "Util.hpp"
12 #include "Time.hpp"
13 
15 
19 class Clock
20 {
21 public:
25  Clock();
26 
31 
38 
39 private:
40  Time lastTime;
41 };
42 
43 SDLU_END
A wrapper around std::chrono::duration.
Basic utility macros, typedefs...
#define SDLU_BEGIN
Definition: Util.hpp:32
Essentially a timer.
Definition: Clock.hpp:20
Time Restart()
Restarts the Clock.
Time GetElapsedTime()
Returns the time elapsed since the last Restart() call.
Clock()
Creates a new Clock. It has not yet been started, call Restart() before doing anything else.
This class wraps std::chrono::duration and defines some conversions for commonly used times.
Definition: Time.hpp:24