Package panda.utilities
Class TimeUtils
java.lang.Object
panda.utilities.TimeUtils
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic Stringformat(double time) Format double representing time to two decimal placesstatic longGet estimated time of JVM boot timestatic doublegetUptime(long uptime) Calculate uptime since the given time in millisecondsstatic StringtoMilliseconds(long nano) Format long representing time in nanoseconds to formatted time in millisecondsstatic StringtoSeconds(long ms) Format long representing time in milliseconds to formatted time in seconds
-
Field Details
-
MILLISECOND
public static final double MILLISECOND- See Also:
-
NANOSECOND
public static final double NANOSECOND- See Also:
-
-
Method Details
-
toSeconds
Format long representing time in milliseconds to formatted time in seconds- Parameters:
ms- the time to format- Returns:
- the formatted time
-
toMilliseconds
Format long representing time in nanoseconds to formatted time in milliseconds- Parameters:
nano- the time to format- Returns:
- the formatted time
-
format
Format double representing time to two decimal places- Parameters:
time- the time to format- Returns:
- the formatted time
-
getUptime
public static double getUptime(long uptime) Calculate uptime since the given time in milliseconds- Parameters:
uptime- the init time- Returns:
- the difference between init time and current time in milliseconds
-
getJVMUptime
public static long getJVMUptime()Get estimated time of JVM boot time- Returns:
- the estimated boot time
-