Timer: Fix >1 second sleeps on MacOS

This commit is contained in:
Stenzek 2024-11-24 22:37:42 +10:00
parent ff010686f8
commit affbdfc350
No known key found for this signature in database
1 changed files with 1 additions and 1 deletions

View File

@ -395,7 +395,7 @@ void Timer::NanoSleep(std::uint64_t ns)
// Round down to the next millisecond.
usleep(static_cast<useconds_t>((ns / 1000000) * 1000));
#else
const struct timespec ts = {0, static_cast<long>(ns)};
const struct timespec ts = {static_cast<long>(ns / 1000000000ULL), static_cast<long>(ns % 1000000000ULL)};
nanosleep(&ts, nullptr);
#endif
}