org.pf.util
Class StopWatch

java.lang.Object
  extended by org.pf.util.StopWatch

public class StopWatch
extends java.lang.Object

A simple stop watch to measure the time between a start and a stop point.

Version:
1.0
Author:
M.Duchrow

Constructor Summary
StopWatch()
          Initialize the new instance with default values.
 
Method Summary
 long getDuration()
          Returns the duration between start and stop in milliseconds.
 void reset()
          Resets the watch to a state before it gets started
 long start()
          Starts the stop watch.
 long stop()
          Stops the stop watch.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StopWatch

public StopWatch()
Initialize the new instance with default values.

Method Detail

start

public long start()
Starts the stop watch. That is, remember current time as start time.

Returns:
The start time

stop

public long stop()
Stops the stop watch. That is, remember current time as stop time.

Returns:
The stop time

getDuration

public long getDuration()
Returns the duration between start and stop in milliseconds. If stop() has not been called yet it returns the duration from start to now.


reset

public void reset()
Resets the watch to a state before it gets started