mirror of
https://github.com/stenzek/duckstation.git
synced 2025-06-10 05:17:19 +00:00
Timer: Fix >1 second sleeps on MacOS
This commit is contained in:
parent
ff010686f8
commit
affbdfc350
@ -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
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user