Ocular Engine
Clock.hpp
1 
17 #pragma once
18 #ifndef __H__OCULAR_TIME_CLOCK__H__
19 #define __H__OCULAR_TIME_CLOCK__H__
20 
21 #include "Time\DateTime.hpp"
22 #include <chrono>
23 
24 //------------------------------------------------------------------------------------------
25 
30 namespace Ocular
31 {
36  namespace Core
37  {
41  class Clock
42  {
43  public:
44 
45  Clock();
46  ~Clock();
47 
52  void tick();
53 
57  float getDelta();
58 
62  uint64_t getEpochMS();
63 
67  uint64_t getEpochNS();
68 
72  uint64_t getElapsedMS();
73 
77  uint64_t getElapsedNS();
78 
83 
84  protected:
85 
86  private:
87 
88  std::chrono::milliseconds::rep m_CreationTimeMS;
89  std::chrono::nanoseconds::rep m_CreationTimeNS;
90 
91  std::chrono::milliseconds::rep m_LastTick;
92  float m_Delta;
93  };
94  }
98 }
103 //------------------------------------------------------------------------------------------
104 
105 #endif
void tick()
Definition: Clock.cpp:52
uint64_t getElapsedMS()
Definition: Clock.cpp:84
Note: Once this library is made dynamic, this will no longer be needed.
Definition: Common.hpp:70
uint64_t getElapsedNS()
Definition: Clock.cpp:89
Definition: DateTime.hpp:40
float getDelta()
Definition: Clock.cpp:61
uint64_t getEpochNS()
Definition: Clock.cpp:75
DateTime getDateTime()
Definition: Clock.cpp:94
Definition: Clock.hpp:41
uint64_t getEpochMS()
Definition: Clock.cpp:66