1
0
mirror of https://github.com/luanti-org/luanti.git synced 2025-10-26 05:15:27 +01: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
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;
}