Fix GLProxy renderThread skipping some tasks

This commit is contained in:
James Seibel
2024-11-09 09:48:37 -06:00
parent 9351b7b834
commit b0f2918daf
@@ -238,16 +238,16 @@ public class GLProxy
Runnable runnable = this.renderThreadRunnableQueue.poll();
while(runnable != null)
{
runnable.run();
// only try running for 4ms (240 FPS) at a time to prevent random lag spikes
long currentTime = System.nanoTime();
long runDuration = currentTime - startTime;
// only try running for 4ms at a time to (hopefully) prevent random lag spikes
if (runDuration > 4_000_000)
{
break;
}
runnable.run();
runnable = this.renderThreadRunnableQueue.poll();
}
}