Scribble Problem Set Javadocs

cs101.util
Class StopWatch

java.lang.Object
  extended bycs101.util.StopWatch

public class StopWatch
extends java.lang.Object

A stopwatch for timing the execution of code. This class is intended to provide aproximate time of execution to a resolution of single digit miliseconds on most modern machines. Estimates of cost on a dual Athlon MP 2000+ machien yeild the following costs for the following methods

Version:
$Id: StopWatch.java,v 1.1 2003/10/16 20:40:51 gus Exp $
Author:
Gus Heck (gus.heck@olin.edu)

Field Summary
static long MS_HOUR
           
static long MS_MIN
           
static long MS_SEC
           
 
Constructor Summary
StopWatch()
          Creates a new instance of StopWatch.
 
Method Summary
 long elapsed()
           
 java.lang.String look()
           
 void reset()
          Reset the stopwatch.
 void start()
          Start the stopwatch.
 void stop()
          Stop the stopwatch.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MS_SEC

public static long MS_SEC

MS_MIN

public static long MS_MIN

MS_HOUR

public static long MS_HOUR
Constructor Detail

StopWatch

public StopWatch()
Creates a new instance of StopWatch.

Method Detail

start

public void start()
Start the stopwatch.


stop

public void stop()
Stop the stopwatch.


reset

public void reset()
Reset the stopwatch. It is perfectly legal and reasonable to reset the stopwatch while it is still running. The elapsed time on the stopwatch is set to 0 regardless.


elapsed

public long elapsed()

look

public java.lang.String look()

Scribble Problem Set Javadocs