public class TimeDurationFormatter extends Object
Stopwatch.toString().| Constructor and Description |
|---|
TimeDurationFormatter(Locale locale,
int threshold,
boolean allowNonAscii) |
| Modifier and Type | Method and Description |
|---|---|
static TimeDurationFormatter |
forLogging()
Default formatter suitable for logging (ASCII-only)
|
String |
format(long amount,
TimeUnit unit)
Format the specified duration
|
public TimeDurationFormatter(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()
Copyright © 2012–2018 The Apache Software Foundation. All rights reserved.