aboutsummaryrefslogtreecommitdiff
path: root/runtime/src/main/java/me/shedaniel/rei/impl/client
diff options
context:
space:
mode:
authorshedaniel <daniel@shedaniel.me>2022-04-23 22:37:42 +0800
committershedaniel <daniel@shedaniel.me>2022-04-23 22:37:42 +0800
commitf024acf13e0f75d5872ec20539870bd83179458e (patch)
tree088181e5b5c123e12f39ef022a43d36b2b0a2b62 /runtime/src/main/java/me/shedaniel/rei/impl/client
parentb04445138664ac1e8151286b0c3858c442da9419 (diff)
downloadRoughlyEnoughItems-f024acf13e0f75d5872ec20539870bd83179458e.tar.gz
RoughlyEnoughItems-f024acf13e0f75d5872ec20539870bd83179458e.tar.bz2
RoughlyEnoughItems-f024acf13e0f75d5872ec20539870bd83179458e.zip
Show total load time in performance screen
Diffstat (limited to 'runtime/src/main/java/me/shedaniel/rei/impl/client')
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/client/gui/performance/PerformanceScreen.java3
1 files changed, 3 insertions, 0 deletions
diff --git a/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/performance/PerformanceScreen.java b/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/performance/PerformanceScreen.java
index b0a77fae4..356c7c5b0 100644
--- a/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/performance/PerformanceScreen.java
+++ b/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/performance/PerformanceScreen.java
@@ -145,6 +145,7 @@ public class PerformanceScreen extends Screen {
}));
}
list = new PerformanceEntryListWidget();
+ long[] totalTime = {0};
RoughlyEnoughItemsCore.PERFORMANCE_LOGGER.getStages().forEach((stage, inner) -> {
List<EntryListEntry> entries = new ArrayList<>();
inner.times().forEach((obj, time) -> {
@@ -158,9 +159,11 @@ public class PerformanceScreen extends Screen {
if ((inner.totalNano() - separateTime) > 1000000) {
entries.add(new EntryListEntry(new TextComponent("Miscellaneous Operations"), inner.totalNano() - separateTime));
}
+ totalTime[0] += inner.totalNano();
entries.sort(Comparator.<EntryListEntry>comparingLong(value -> value.time).reversed());
list.addItem(new SubCategoryListEntry(new TextComponent(stage), (List<PerformanceScreen.PerformanceEntry>) (List<? extends PerformanceScreen.PerformanceEntry>) entries, inner.totalNano(), false));
});
+ list.children().add(0, new EntryListEntry(new TextComponent("Total Load Time"), totalTime[0]));
addWidget(list);
}