mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-11 05:26:24 +02:00
Throw in some sanity checks of usleep
This commit is contained in:
1 parent
53cfecf8fa
commit
96dcf40c79
1 file changed
+6
-2
@@ -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