export module Core.Clock; import Core.Array; export namespace Core { struct Clock final { size_t index; i64 last; i64 sum; Array 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; }; }