Class ExactTimer

  extended by org.e2etrace.timer.ExactTimer
All Implemented Interfaces:

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.

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


public void start()
Starts the timer.

Specified by:
start in interface ITimer


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

Specified by:
measure in interface ITimer
duration in ms

Copyright © 2013 Gunther Popp. All Rights Reserved.