From 9a3b3aeafd7e48194d0a5a3fbe459b965f5d12fa Mon Sep 17 00:00:00 2001 From: superp00t Date: Fri, 11 Apr 2025 23:35:20 -0400 Subject: [PATCH] feat(time): add basic OsGetAsyncClocksPerSecond for Mac and Linux --- common/time/linux/Time.cpp | 6 +++++- common/time/mac/Time.cpp | 5 +++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/common/time/linux/Time.cpp b/common/time/linux/Time.cpp index d4a1ea5..b85b2f9 100644 --- a/common/time/linux/Time.cpp +++ b/common/time/linux/Time.cpp @@ -19,6 +19,10 @@ uint64_t OsGetAsyncTimeMsPrecise() { return ticks; } +int64_t OsGetAsyncClocksPerSecond() { + return 1000LL; +} + uint64_t OsGetAsyncTimeMs() { return OsGetAsyncTimeMsPrecise(); } @@ -27,4 +31,4 @@ void OsSleep(uint32_t duration) { usleep(duration); } -#endif \ No newline at end of file +#endif diff --git a/common/time/mac/Time.cpp b/common/time/mac/Time.cpp index f7423af..e6fb5d7 100644 --- a/common/time/mac/Time.cpp +++ b/common/time/mac/Time.cpp @@ -28,6 +28,11 @@ uint64_t OsGetAsyncTimeMs() { return OsGetAsyncTimeMsPrecise(); } +int64_t OsGetAsyncClocksPerSecond() { + // TODO: verify + return 1000LL; +} + void OsSleep(uint32_t duration) { usleep(duration); }