Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

iiuf.util
Class StopWatch  view StopWatch download StopWatch.java

java.lang.Object
  extended byiiuf.util.StopWatch

public class StopWatch
extends java.lang.Object

A handy stopwatch class. (c) 2000, 2001, IIUF, DIUF

Version:
$Revision: 1.1 $

Field Summary
(package private)  long started
           
(package private)  int state
           
(package private) static int STATE_RUNNING
           
(package private) static int STATE_STOPPED
           
(package private)  long stopped
           
 
Constructor Summary
StopWatch()
           
 
Method Summary
 long getMillis()
          If the watch is still running, returns the number of milliseconds elapsed since the start.
 StopWatch start()
          Start the watch.
 long stop()
          Stop the stopwatch.
 java.lang.String toString()
          Returns the elapsed time in a human-readable format.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

STATE_RUNNING

static final int STATE_RUNNING
See Also:
Constant Field Values

STATE_STOPPED

static final int STATE_STOPPED
See Also:
Constant Field Values

state

int state

started

long started

stopped

long stopped
Constructor Detail

StopWatch

public StopWatch()
Method Detail

start

public StopWatch start()
Start the watch.


stop

public long stop()
Stop the stopwatch.


getMillis

public long getMillis()
If the watch is still running, returns the number of milliseconds elapsed since the start. If the watch is stopped, returns the number of milliseconds between start and stop.


toString

public java.lang.String toString()
Returns the elapsed time in a human-readable format.