()
| 40 | private static long renderTimeNano = 0L; |
| 41 | |
| 42 | public static void updateLagometer() |
| 43 | { |
| 44 | if (mc == null) |
| 45 | { |
| 46 | mc = Minecraft.getMinecraft(); |
| 47 | gameSettings = mc.gameSettings; |
| 48 | profiler = mc.mcProfiler; |
| 49 | } |
| 50 | |
| 51 | if (gameSettings.showDebugProfilerChart && (gameSettings.ofLagometer || gameSettings.field_181657_aC)) |
| 52 | { |
| 53 | active = true; |
| 54 | long timeNowNano = System.nanoTime(); |
| 55 | |
| 56 | if (prevFrameTimeNano == -1L) |
| 57 | { |
| 58 | prevFrameTimeNano = timeNowNano; |
| 59 | } |
| 60 | else |
| 61 | { |
| 62 | int j = numRecordedFrameTimes & timesFrame.length - 1; |
| 63 | ++numRecordedFrameTimes; |
| 64 | boolean flag = MemoryMonitor.isGcEvent(); |
| 65 | timesFrame[j] = timeNowNano - prevFrameTimeNano - renderTimeNano; |
| 66 | timesTick[j] = timerTick.timeNano; |
| 67 | timesScheduledExecutables[j] = timerScheduledExecutables.timeNano; |
| 68 | timesChunkUpload[j] = timerChunkUpload.timeNano; |
| 69 | timesChunkUpdate[j] = timerChunkUpdate.timeNano; |
| 70 | timesVisibility[j] = timerVisibility.timeNano; |
| 71 | timesTerrain[j] = timerTerrain.timeNano; |
| 72 | timesServer[j] = timerServer.timeNano; |
| 73 | gcs[j] = flag; |
| 74 | timerTick.reset(); |
| 75 | timerScheduledExecutables.reset(); |
| 76 | timerVisibility.reset(); |
| 77 | timerChunkUpdate.reset(); |
| 78 | timerChunkUpload.reset(); |
| 79 | timerTerrain.reset(); |
| 80 | timerServer.reset(); |
| 81 | prevFrameTimeNano = System.nanoTime(); |
| 82 | } |
| 83 | } |
| 84 | else |
| 85 | { |
| 86 | active = false; |
| 87 | prevFrameTimeNano = -1L; |
| 88 | } |
| 89 | } |
| 90 | |
| 91 | public static void showLagometer(ScaledResolution scaledResolution) |
| 92 | { |
no test coverage detected