public final class TimeUtil extends Object
| Modifier and Type | Method and Description | 
|---|---|
static String | 
formatTime(long durationNS)
Formats time in a readable output. 
 | 
static String | 
formatTime(long durationNS,
          TimeUnit min)
Formats time in a readable output. 
 | 
static String | 
formatTime(TimePoint point)
Formats time in a readable output. 
 | 
static String | 
formatTime(TimePoint point,
          TimeUnit min)
Formats time in a readable output. 
 | 
static String | 
getProperUnitName(TimeUnit unit,
                 long amount)
Returns the appropriate spelling for a  
TimeUnit value based on
 the value of the "amount" parameter. | 
static String | 
getTime(long start)
Returns a formatted string of how long ago the passed time was 
 | 
public static String getTime(long start)
start - How long ago something was in nanosecondspublic static String formatTime(long durationNS)
TimeUtil.formatTime(durationNS, TimeUnit.NANOSECONDS)durationNS - The amount of time in nanosecondsformatTime(long, TimeUnit)public static String formatTime(long durationNS, TimeUnit min)
TimeUtil.formatTime(TimePoint, TimeUnit.NANOSECONDS)durationNS - The amount of time in nanosecondsmin - The minimum (inclusive) unit of time to output as a secondary
 measurementformatTime(TimePoint, TimeUnit)public static String formatTime(TimePoint point)
TimeUtil.formatTime(point, TimeUnit.NANOSECONDS)point - The TimePoint to useformatTime(TimePoint, TimeUnit)public static String formatTime(TimePoint point, TimeUnit min)
point - The TimePoint to usemin - The minimum (inclusive) unit of time to output as a secondary
 measurementpublic static String getProperUnitName(TimeUnit unit, long amount)
TimeUnit value based on
 the value of the "amount" parameter. Values other than 1 will return a
 plural measurement whereas 1 will return a singular measurement.unit - The unit to beautifyamount - The amount relevant to the measurement outputCopyright © 2017. All rights reserved.