public class TimeDurationFormatter
extends java.lang.Object
Stopwatch.toString()
.Constructor and Description |
---|
TimeDurationFormatter(java.util.Locale locale,
int threshold,
boolean allowNonAscii) |
Modifier and Type | Method and Description |
---|---|
static TimeDurationFormatter |
forLogging()
Default formatter suitable for logging (ASCII-only)
|
java.lang.String |
format(long amount,
java.util.concurrent.TimeUnit unit)
Format the specified duration
|
public TimeDurationFormatter(java.util.Locale locale, int threshold, boolean allowNonAscii)
locale
- locale for formatting (affects the decimal point)threshold
- integral value that needs to be exceeded to switch to a
certain time unit for display (e.g., specify 2
to
switch to 'days' when the elapsed time is two or more days.allowNonAscii
- set to true
if the display unit can use the non-ASCII
"micro" Unicode characterpublic static TimeDurationFormatter forLogging()
public java.lang.String format(long amount, java.util.concurrent.TimeUnit unit)
amount
- number of time unitsunit
- time unitCopyright © 2010 - 2020 Adobe. All Rights Reserved