util
Class ThreadTimer
java.lang.Object
util.ThreadTimer
public final class ThreadTimer
- extends Object
Class that allows per-thread timing that excludes GC time. This class is
thread safe.
The class is used by instantiating a new object at each "tick" The time
between two ticks (exclusive of GC time) can then be calculated using the
static method elapsedTime().
Note that this class requires the use of a stop-the-world collector (as it
assumes that no mutator activity occurs while the GC is running)
Method Summary |
static ThreadTimer.Tick |
tick()
Creates a new tick, fixing the start time of the current event |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ThreadTimer
public ThreadTimer()
tick
public static ThreadTimer.Tick tick()
- Creates a new tick, fixing the start time of the current event
- Returns:
- a tick object