mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-07-11 01:25:07 +02:00
Throw in some sanity checks of usleep
This commit is contained in:
@@ -484,7 +484,9 @@ static void DoFrameIdleTiming() {
|
||||
sleep_ms(1);
|
||||
#else
|
||||
const double left = goal - cur_time;
|
||||
usleep((long)(left * 1000000));
|
||||
if (left > 0.0f && left < 1.0f) { // Sanity check
|
||||
usleep((long)(left * 1000000));
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -743,7 +745,9 @@ void hleLagSync(u64 userdata, int cyclesLate) {
|
||||
// Tight loop on win32 - intentionally, as timing is otherwise not precise enough.
|
||||
#ifndef _WIN32
|
||||
const double left = goal - now;
|
||||
usleep((long)(left * 1000000.0));
|
||||
if (left > 0.0f && left < 1.0f) { // Sanity check
|
||||
usleep((long)(left * 1000000.0));
|
||||
}
|
||||
#else
|
||||
yield();
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user