From 718f615d3faf42c466ebc2d4390efab38851c965 Mon Sep 17 00:00:00 2001 From: Andrew Steinborn Date: Mon, 13 Aug 2018 07:23:49 -0400 Subject: [PATCH] Simplify and improve the startup timer. --- .../src/main/java/com/velocitypowered/proxy/Velocity.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/proxy/src/main/java/com/velocitypowered/proxy/Velocity.java b/proxy/src/main/java/com/velocitypowered/proxy/Velocity.java index fb79d0a80..8ab722a2e 100644 --- a/proxy/src/main/java/com/velocitypowered/proxy/Velocity.java +++ b/proxy/src/main/java/com/velocitypowered/proxy/Velocity.java @@ -4,9 +4,7 @@ import com.velocitypowered.proxy.console.VelocityConsole; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -import java.text.SimpleDateFormat; -import java.util.Date; -import java.util.Locale; +import java.text.DecimalFormat; public class Velocity { private static final Logger logger = LogManager.getLogger(Velocity.class); @@ -28,7 +26,8 @@ public class Velocity { Runtime.getRuntime().addShutdownHook(new Thread(server::shutdown, "Shutdown thread")); - logger.info("Done ({}s)!", new SimpleDateFormat("ss.S", Locale.getDefault()).format(new Date(System.currentTimeMillis() - startTime))); + double bootTime = (System.currentTimeMillis() - startTime) / 1000d; + logger.info("Done ({}s)!", new DecimalFormat("#.##").format(bootTime)); new VelocityConsole(server).start(); } }