123456789101112131415161718192021222324 |
- #ifndef CLOCK_H
- #define CLOCK_H
- #include "utils/Array.h"
- #include "rendering/wrapper/GLFW.h"
- class Clock final {
- static constexpr int bits = 7;
- static constexpr int length = 1 << bits;
-
- int index;
- Nanos last;
- Nanos sum;
- Array<Nanos, length> time;
-
- public:
- Clock();
- Nanos update();
- Nanos getLength() const;
- float getUpdatesPerSecond() const;
- };
- #endif
|