public class Timer extends Object implements AutoCloseable
Usage:
try (Timer ignored = new Timer("doing something")) { ... }| Modifier and Type | Class and Description |
|---|---|
static class |
Timer.TimerResult |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
static void |
end(String name)
Deprecated.
use
try (Timer ignored = new Timer("...")) { .. } instead |
static String |
formatDurationNanos(long durationNanoSeconds) |
protected static String |
getPrefix() |
static Timer.TimerResult |
measureWallclockTime(Runnable task,
long minimumDurationMillis) |
static void |
start(String name)
Deprecated.
use
try (Timer ignored = new Timer("...")) { .. } instead |
protected String name
public Timer(String x)
protected static String getPrefix()
public static void start(String name)
try (Timer ignored = new Timer("...")) { .. } insteadpublic static String formatDurationNanos(long durationNanoSeconds)
public static void end(String name)
try (Timer ignored = new Timer("...")) { .. } insteadpublic static Timer.TimerResult measureWallclockTime(Runnable task, long minimumDurationMillis)
task - runs this multiple timesminimumDurationMillis - thousandths of a secondcom.google.common.base.Stopwatchpublic void close()
close in interface AutoCloseableCopyright © 2003–2018. All rights reserved.