From affbdfc350028cce60b476d563eb34bb92da6a1d Mon Sep 17 00:00:00 2001 From: Stenzek Date: Sun, 24 Nov 2024 22:37:42 +1000 Subject: [PATCH] Timer: Fix >1 second sleeps on MacOS --- src/common/timer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/timer.cpp b/src/common/timer.cpp index bdcb20cde..6b74097d8 100644 --- a/src/common/timer.cpp +++ b/src/common/timer.cpp @@ -395,7 +395,7 @@ void Timer::NanoSleep(std::uint64_t ns) // Round down to the next millisecond. usleep(static_cast((ns / 1000000) * 1000)); #else - const struct timespec ts = {0, static_cast(ns)}; + const struct timespec ts = {static_cast(ns / 1000000000ULL), static_cast(ns % 1000000000ULL)}; nanosleep(&ts, nullptr); #endif }