|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jboss.util.StopWatch
Simulates a stop watch with a lap counter.
Field Summary | |
protected int |
count
The lap count |
protected boolean |
running
Is the watch started |
protected long |
start
Start time |
protected long |
stop
Stop time |
protected long |
total
Total time |
Constructor Summary | |
StopWatch()
Default constructor. |
|
StopWatch(boolean running)
Construct a StopWatch. |
Method Summary | |
Object |
clone()
Return a cloned copy of this object. |
long |
getAverageLapTime()
Get the average lap time since the watch was started. |
int |
getLapCount()
Get the lap count. |
long |
getLapTime()
Get the elapsed lap time since the watch was started. |
long |
getTime()
Get the elapsed time since the watch was created or last reset. |
boolean |
isRunning()
Check if the watch is running. |
static StopWatch |
makeSynchronized(StopWatch watch)
Return a synchronized stop watch. |
void |
reset()
Reset the watch. |
void |
start()
Start the watch. |
void |
start(boolean reset)
Start the watch. |
long |
stop()
Stop the watch. |
String |
toString()
Return a string representation. |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected long total
protected long start
protected long stop
protected int count
protected boolean running
Constructor Detail |
public StopWatch()
public StopWatch(boolean running)
running
- Start the watchMethod Detail |
public void start(boolean reset)
reset
- True to reset the watch prior to starting.public void start()
public long stop()
public void reset()
public int getLapCount()
public long getLapTime()
public long getAverageLapTime()
public long getTime()
public boolean isRunning()
public String toString()
public Object clone()
public static StopWatch makeSynchronized(StopWatch watch)
watch
- StopWatch to synchronize.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |