diff --git a/src/sdl/i_system.c b/src/sdl/i_system.c index 4d62c42875856b6a35a9ca3afd3aab39a35f6109..18a5cb46d2e8d2237cb4bcd39616708f1d34bfa4 100644 --- a/src/sdl/i_system.c +++ b/src/sdl/i_system.c @@ -2310,9 +2310,9 @@ void I_SleepDuration(precise_t duration) #if defined(__linux__) || defined(__FreeBSD__) || defined(__HAIKU__) UINT64 precision = I_GetPrecisePrecision(); precise_t dest = I_GetPreciseTime() + duration; - if (duration > 100000) + if (duration * 100000 / precision > 1) { - duration -= 100000; // 0.1 ms slack + duration -= (precision / 10000); // 0.1 ms slack struct timespec ts = { .tv_sec = duration / precision, .tv_nsec = duration * 1000000000 / precision % 1000000000,