9
0
mirror of https://gitlab.com/SamB440/rpgregions-2.git synced 2025-12-27 10:49:08 +00:00

Only show async execution time if specified

This commit is contained in:
SamB440
2021-10-09 17:16:52 +01:00
parent e50fb0262b
commit dee0463b82

View File

@@ -186,8 +186,10 @@ public class RPGRegionsCommand extends BaseCommand {
long mainTotalTime = mainEndTime - startTime;
saveFuture.thenAccept(saved -> {
long asyncTotalTime = System.currentTimeMillis() - asyncStartTime;
sender.sendMessage(ChatColor.GREEN + "Done! (" + mainTotalTime + "ms) "
+ ChatColor.GOLD + "(async execution took " + asyncTotalTime + "ms)");
StringBuilder sb = new StringBuilder();
sb.append(ChatColor.GREEN).append("Done! (%sms)".formatted(mainTotalTime));
if (async) sb.append(' ').append(ChatColor.GOLD).append("(async execution took %sms)".formatted(asyncTotalTime));
sender.sendMessage(sb.toString());
});
}