diff options
author | makamys <makamys@outlook.com> | 2021-05-10 22:02:01 +0200 |
---|---|---|
committer | makamys <makamys@outlook.com> | 2021-05-10 22:02:01 +0200 |
commit | 6741084ce1cee8648edb4af418a879321a7de4c0 (patch) | |
tree | 752352aa738b6ad97010edb70d5b3ef11caf4733 /src/main/java/makamys/lodmod/renderer/LODRenderer.java | |
parent | f3c2b5d401fb09824e66092ac0593849ae29ee6c (diff) | |
download | Neodymium-6741084ce1cee8648edb4af418a879321a7de4c0.tar.gz Neodymium-6741084ce1cee8648edb4af418a879321a7de4c0.tar.bz2 Neodymium-6741084ce1cee8648edb4af418a879321a7de4c0.zip |
Change save interval to 60 seconds
Diffstat (limited to 'src/main/java/makamys/lodmod/renderer/LODRenderer.java')
-rw-r--r-- | src/main/java/makamys/lodmod/renderer/LODRenderer.java | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/main/java/makamys/lodmod/renderer/LODRenderer.java b/src/main/java/makamys/lodmod/renderer/LODRenderer.java index 4b2e016..7578633 100644 --- a/src/main/java/makamys/lodmod/renderer/LODRenderer.java +++ b/src/main/java/makamys/lodmod/renderer/LODRenderer.java @@ -81,7 +81,9 @@ public class LODRenderer { private double lastSortZ = Double.NaN; private long lastGCTime = -1; - private long gcInterval = 60 * 1000; + private long lastSaveTime = -1; + private long gcInterval = 10 * 1000; + private long saveInterval = 60 * 1000; public int renderRange = 48; @@ -105,12 +107,14 @@ public class LODRenderer { mainLoop(); handleKeyboard(); - gcInterval = 10 * 1000; if(lastGCTime == -1 || (System.currentTimeMillis() - lastGCTime) > gcInterval) { runGC(); - onSave(); lastGCTime = System.currentTimeMillis(); } + if(lastSaveTime == -1 || (System.currentTimeMillis() - lastSaveTime) > saveInterval) { + onSave(); + lastSaveTime = System.currentTimeMillis(); + } if(renderLOD) { sort(); |