Clock.h 455 B

1234567891011121314151617181920212223
  1. #ifndef CLOCK_H
  2. #define CLOCK_H
  3. #include "gaming-core/utils/Array.h"
  4. #include "client/rendering/wrapper/GLFWWrapper.h"
  5. class Clock final {
  6. static constexpr int BITS = 7;
  7. static constexpr int LENGTH = 1 << BITS;
  8. int index;
  9. GLFWWrapper::Nanos last;
  10. GLFWWrapper::Nanos sum;
  11. Array<GLFWWrapper::Nanos, LENGTH> time;
  12. public:
  13. Clock();
  14. GLFWWrapper::Nanos update();
  15. float getUpdatesPerSecond() const;
  16. };
  17. #endif