|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.sun.labs.minion.util.StopWatch
public class StopWatch
A class implementing a simple stop watch that can be used for timing.
Field Summary | |
---|---|
protected int |
clicks
The number of starts and stops since the last reset. |
protected long |
lastStart
The last start time. |
protected long |
lastTime
The amount of time for the last start/stop pair. |
protected long |
time
The amount of time accumulated on the timer. |
Constructor Summary | |
---|---|
StopWatch()
Creates a new stop watch. |
Method Summary | |
---|---|
void |
accumulate(StopWatch sw)
|
double |
getAvgTime()
|
int |
getClicks()
Gets the number of times that the watch was started and stopped since the last reset. |
long |
getLastTime()
|
long |
getTime()
Gets the number of milliseconds on the timer. |
void |
reset()
Resets the accumulated time. |
void |
start()
Starts the timer. |
void |
stop()
Stops the timer. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected long time
protected long lastTime
protected int clicks
protected long lastStart
Constructor Detail |
---|
public StopWatch()
Method Detail |
---|
public void start()
public void stop()
public void reset()
public long getTime()
public long getLastTime()
public double getAvgTime()
public int getClicks()
reset()
public void accumulate(StopWatch sw)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |