org.e2etrace.timer
Class ExactTimer

java.lang.Object
  extended by org.e2etrace.timer.ExactTimer
All Implemented Interfaces:
ITimer

public class ExactTimer
extends Object
implements ITimer

Timer Implementation with high accuracy regardless of the operating system.

New JDKs provide an API for measuring time intervals that works accurate on all operating systems. To be exact: It guarantees the accuracy the operating system is able to deliver. In most to all cases this should be about 1-2ms.

Author:
Gunther Popp

Method Summary
 long measure()
          Returns the duration in ms since start().
 void start()
          Starts the timer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

start

public void start()
Starts the timer.

Specified by:
start in interface ITimer

measure

public long measure()
Returns the duration in ms since start().

Specified by:
measure in interface ITimer
Returns:
duration in ms


Copyright © 2013 Gunther Popp. All Rights Reserved.