Class StopWatch

java.lang.Object
  extended by StopWatch

public class StopWatch
extends java.lang.Object

A millisecond stop watch

Version:
July 2005
Author:
Todd A. Whittaker

Constructor Summary
StopWatch()
          Build a stop watch in the stopped state, with no elapsed time
 
Method Summary
 long getElapsedTime()
          Extract the elapsed time in milliseconds
 boolean isRunning()
          Determine if the stop watch is running
 void reset()
          Stop the timer and reset to 0 elapsed time
 void start()
          Starts the timer
 void stop()
          Stops the timer
 java.lang.String toString()
          String representation of the elapsed time
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

StopWatch

public StopWatch()
Build a stop watch in the stopped state, with no elapsed time

Method Detail

getElapsedTime

public long getElapsedTime()
Extract the elapsed time in milliseconds

Returns:
elapsed time in milliseconds

isRunning

public boolean isRunning()
Determine if the stop watch is running

Returns:
true when the timer is running, false otherwise

reset

public void reset()
Stop the timer and reset to 0 elapsed time


start

public void start()
Starts the timer


stop

public void stop()
Stops the timer


toString

public java.lang.String toString()
String representation of the elapsed time

Overrides:
toString in class java.lang.Object