com.claritysys.util
Class Stopwatch

java.lang.Object
  extended by com.claritysys.util.Stopwatch

public final class Stopwatch
extends java.lang.Object

A useful (well, hopefully) class for timing a set of operations.

It just calls System.currentTimeMillis.

Its probably not really accurate because of all the extra method calls, but it sure is convenient. Its mostly for feedback, not benchmarking.


Constructor Summary
Stopwatch()
          Create a new stopwatch, and mark the time of creation.
 
Method Summary
 long elapsed()
          Return the elapsed time in milliseconds between when the last restart() ocurred and the current system time.
 void restart()
          Reset the start time to the current system time.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Stopwatch

public Stopwatch()
Create a new stopwatch, and mark the time of creation.

Method Detail

restart

public void restart()
Reset the start time to the current system time.


elapsed

public long elapsed()
Return the elapsed time in milliseconds between when the last restart() ocurred and the current system time.



Copyright ? 2002 Clarity Systems Group, LLC. All Rights Reserved.