| 1234567891011121314151617181920212223 |
- export module Core.Clock;
- import Core.Array;
- export namespace Core {
- struct Clock final {
- size_t index;
- i64 last;
- i64 sum;
- Array<i64, 1 << 7> time;
- public:
- Clock() noexcept;
- // the first invocation will always return 0 nanos
- i64 update() noexcept;
- float getUpdatesPerSecond() const noexcept;
- static bool sleepNanos(i64 nanos) noexcept;
- static bool sleepMillis(i64 millis) noexcept;
- static i64 getNanos() noexcept;
- };
- }
|