java.lang.Object
iiuf.util.StopWatch
- public class StopWatch
- extends java.lang.Object
A handy stopwatch class.
(c) 2000, 2001, IIUF, DIUF
- Version:
- $Revision: 1.1 $
|
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. |
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
StopWatch
public StopWatch()
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.