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, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getCurrentValue, isConditional, setConditional
private static final ThreadMXBean threadMXBean
private static final ThreadLocal<CloseableCounterImpl> currentTimer
public DebugCloseable start()
DebugTimer
start
in interface DebugTimer
public static String valueToString(long value)
public DebugTimer getFlat()
DebugTimer
getFlat
in interface DebugTimer
public String toString(long value)
toString
in class DebugValue
public TimeUnit getTimeUnit()
DebugTimer
getTimeUnit
in interface DebugTimer