public final class TimerImpl extends AccumulatedDebugValue implements DebugTimer
| Modifier and Type | Class and Description |
|---|---|
private static class |
TimerImpl.AbstractTimer |
private class |
TimerImpl.CpuTimeTimer |
(package private) static class |
TimerImpl.FlatTimer |
private class |
TimerImpl.SystemNanosTimer |
| Modifier and Type | Field and Description |
|---|---|
private static ThreadLocal<CloseableCounterImpl> |
currentTimer
Records the most recent active timer.
|
private static ThreadMXBean |
threadMXBean |
flat| Constructor and Description |
|---|
TimerImpl(String name,
boolean conditional) |
| Modifier and Type | Method and Description |
|---|---|
DebugTimer |
getFlat()
Gets the timer recording the amount time spent within a timed scope minus the time spent in
any nested timed scopes.
|
TimeUnit |
getTimeUnit()
Gets the time unit of this timer.
|
DebugCloseable |
start()
Starts this timer if timing is enabled or this is an
unconditional timer.
|
String |
toString(long value) |
static String |
valueToString(long value) |
addToCurrentValue, compareTo, getCurrentValue, getIndex, getName, isConditional, setConditional, setCurrentValue, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetCurrentValue, isConditional, setConditionalprivate static final ThreadMXBean threadMXBean
private static final ThreadLocal<CloseableCounterImpl> currentTimer
public DebugCloseable start()
DebugTimerstart in interface DebugTimerpublic static String valueToString(long value)
public DebugTimer getFlat()
DebugTimergetFlat in interface DebugTimerpublic String toString(long value)
toString in class DebugValuepublic TimeUnit getTimeUnit()
DebugTimergetTimeUnit in interface DebugTimer