| 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();
- // the first invocation will always return 0 nanos
- i64 update();
- float getUpdatesPerSecond() const;
- static bool sleepNanos(i64 nanos);
- static bool sleepMillis(i64 millis);
- static i64 getNanos();
- };
- }
|