util
Class ThreadTimer

java.lang.Object
  extended by 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)


Nested Class Summary
static class ThreadTimer.Tick
          A moment in time
 
Constructor Summary
ThreadTimer()
           
 
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
 

Constructor Detail

ThreadTimer

public ThreadTimer()
Method Detail

tick

public static ThreadTimer.Tick tick()
Creates a new tick, fixing the start time of the current event

Returns:
a tick object