1234567891011121314151617181920212223 |
- #ifndef CLOCK_H
- #define CLOCK_H
- #include "common/utils/Types.h"
- #include "common/utils/Array.h"
- class Clock final {
- public:
- Clock();
- u64 update();
- u64 getLength() const;
- float getUpdatesPerSecond() const;
- private:
- static constexpr u64 bits = 7;
- static constexpr u64 length = 1 << bits;
- u64 last;
- u64 index;
- s64 sum;
- Array<u64, length> time;
- };
- #endif
|