org.jagatoo.util.timing
Class JavaTimer

java.lang.Object
  extended by org.jagatoo.util.timing.JavaTimer
All Implemented Interfaces:
TimerInterface

public final class JavaTimer
extends java.lang.Object
implements TimerInterface

Java implementation of the timer.


Constructor Summary
JavaTimer()
           
 
Method Summary
 long getMicroseconds()
          
 long getMilliseconds()
          
 long getNanoseconds()
          
 long getResolution()
          
 long getTime()
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JavaTimer

public JavaTimer()
Method Detail

getResolution

public final long getResolution()

Specified by:
getResolution in interface TimerInterface
Returns:
number of ticks per second that this timer generates

getTime

public final long getTime()

Specified by:
getTime in interface TimerInterface
Returns:
timer tick value. Divide by getResolution to get second, or divide by getResolution()*1000 to get milli seconds, 1000000 to get microseconds

getMilliseconds

public final long getMilliseconds()

Specified by:
getMilliseconds in interface TimerInterface
Returns:
the current milliseconds value

getMicroseconds

public final long getMicroseconds()

Specified by:
getMicroseconds in interface TimerInterface
Returns:
the current microseconds value

getNanoseconds

public final long getNanoseconds()

Specified by:
getNanoseconds in interface TimerInterface
Returns:
the current nanoseconds value