Modifier and Type | Class and Description |
---|---|
static class |
TimeUtil.Countdown |
static class |
TimeUtil.TimePoint |
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(TimeUtil.TimePoint point)
Formats time in a readable output.
|
static String |
formatTime(TimeUtil.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) |
public static String getTime(long start)
public 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(TimeUtil.TimePoint point)
TimeUtil.formatTime(point, TimeUnit.NANOSECONDS)
point
- The TimeUtil.TimePoint
to useformatTime(TimePoint, TimeUnit)
public static String formatTime(TimeUtil.TimePoint point, TimeUnit min)
point
- The TimeUtil.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 © 2015. All rights reserved.