Class HumanReadableTimeUtils


  • public final class HumanReadableTimeUtils
    extends Object
    Class to create a human-readable time from a duration
    • Method Detail

      • toHumanReadable

        public static String toHumanReadable​(long nanoseconds)
        Method to convert a duration into a human-readable time
        Parameters:
        nanoseconds - nanoseconds
        Returns:
        the return value
      • toHumanReadable

        public static String toHumanReadable​(long nanoseconds,
                                             boolean useShortFormat)
        Method to convert a duration into a human-readable time
        Parameters:
        nanoseconds - nanoseconds
        useShortFormat - useShortFormat
        Returns:
        the return value
      • now

        public static String now()
        Method to get the current time as a String
        Returns:
        the return value
      • toTimingUnit

        public static String toTimingUnit​(long nanoseconds,
                                          String timingUnit)
        Method to convert nanoseconds to specific timing unit String
        Parameters:
        timingUnit - timingUnit
        nanoseconds - nanoseconds
        Returns:
        a String representing the converted nanoseconds value