Class TimeUtils

java.lang.Object
panda.utilities.TimeUtils

public final class TimeUtils extends Object
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final double
     
    static final double
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static String
    format(double time)
    Format double representing time to two decimal places
    static long
    Get estimated time of JVM boot time
    static double
    getUptime(long uptime)
    Calculate uptime since the given time in milliseconds
    static String
    toMilliseconds(long nano)
    Format long representing time in nanoseconds to formatted time in milliseconds
    static String
    toSeconds(long ms)
    Format long representing time in milliseconds to formatted time in seconds

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Method Details

    • toSeconds

      public static String toSeconds(long ms)
      Format long representing time in milliseconds to formatted time in seconds
      Parameters:
      ms - the time to format
      Returns:
      the formatted time
    • toMilliseconds

      public static String toMilliseconds(long nano)
      Format long representing time in nanoseconds to formatted time in milliseconds
      Parameters:
      nano - the time to format
      Returns:
      the formatted time
    • format

      public static String format(double time)
      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