1234567891011121314151617181920212223 |
- #ifndef CLOCK_H
- #define CLOCK_H
- #include "gaming-core/utils/Array.h"
- #include "client/rendering/wrapper/GLFWWrapper.h"
- class Clock final {
- static constexpr int BITS = 7;
- static constexpr int LENGTH = 1 << BITS;
-
- int index;
- GLFWWrapper::Nanos last;
- GLFWWrapper::Nanos sum;
- Array<GLFWWrapper::Nanos, LENGTH> time;
-
- public:
- Clock();
-
- GLFWWrapper::Nanos update();
- float getUpdatesPerSecond() const;
- };
- #endif
|