Ocular Engine
Timer.hpp
1 
17 #pragma once
18 #ifndef __H__OCULAR_TIME_TIMER__H__
19 #define __H__OCULAR_TIME_TIMER__H__
20 
21 #include "OcularEngine.hpp"
22 
23 #include <functional>
24 #include <list>
25 #include <utility>
26 #include <thread>
27 
28 //------------------------------------------------------------------------------------------
29 
34 namespace Ocular
35 {
40  namespace Core
41  {
45  class Timer
46  {
47  public:
48 
49  Timer();
50  ~Timer();
51 
55  void start();
56 
60  void stop();
61 
65  void reset();
66 
73  uint64_t getElapsedMS();
74 
75  protected:
76 
77  private:
78 
79  void updateInternalTime();
80 
81  bool m_Stopped;
82 
83  uint64_t m_ElapsedMS;
84  uint64_t m_LastUpdate;
85  };
86  }
90 }
95 //------------------------------------------------------------------------------------------
96 
97 #endif
uint64_t getElapsedMS()
Definition: Timer.cpp:63
Note: Once this library is made dynamic, this will no longer be needed.
Definition: Common.hpp:70
void stop()
Definition: Timer.cpp:51
void reset()
Definition: Timer.cpp:57
void start()
Definition: Timer.cpp:45
Definition: Timer.hpp:45