1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Improve sleep accuracy on FPS limiter (#15648)

This commit is contained in:
Hanicef 2025-01-12 14:49:13 +01:00 committed by GitHub
parent d4a6df3389
commit be75e42d77
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 20 additions and 2 deletions

View file

@ -50,8 +50,7 @@ void FpsControl::limit(IrrlichtDevice *device, f32 *dtime, bool assume_paused)
if (busy_time < frametime_min) {
sleep_time = frametime_min - busy_time;
if (sleep_time > 0)
sleep_us(sleep_time);
porting::preciseSleepUs(sleep_time);
} else {
sleep_time = 0;
}