Fix render timer breaking when system time changes (fixes #633)

Unlike `currentTimeMillis`, `nanoTime` is guaranteed to be relative to a
fixed point in time, regardless of system or wall-clock time.
This commit is contained in:
Jonas Herzig
2022-03-02 16:54:59 +01:00
parent e26480f041
commit 2e34a2abd9

View File

@@ -141,7 +141,7 @@ public class GuiVideoRenderer extends GuiScreen implements Tickable {
@Override
public void tick() {
long current = System.currentTimeMillis();
long current = System.nanoTime() / 1_000_000;
//first, update the total render time (only if rendering is not paused and has already started)
if(!renderer.isPaused() && renderer.getFramesDone() > 0 && prevTime > -1) {