|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.pelzer.util.StopWatch
public class StopWatch
This is a quick utility to aid in getting timing info for debugging/etc. Basic usage is:
StopWatch watch = new StopWatch();
watch.start(); // Calls an implicit reset();
sleep(1000);
System.out.println(watch.getElapsed().toString); // Should be something like "00:00:01:00";
sleep(2000);
watch.stop();
sleep(2000);
System.out.println(watch.getElapsed().toString); // Should be something like "00:00:03:00";
| Constructor Summary | |
|---|---|
StopWatch()
Creates a new stopwatch. |
|
| Method Summary | |
|---|---|
Timecode |
getElapsed()
Can be called at any time, returns a SMPTE object with 1000 frames/sec (corresponding to milliseconds) representing the time elapsed since start() is called. |
boolean |
isRunning()
|
void |
reset()
Resets elapsed time to zero and stops the clock ticking. |
void |
start()
If the clock is not ticking, resets the elapsed time reset() and then starts the clock. |
void |
stop()
Stops the clock if it is running. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public StopWatch()
start() to begin timing.
| Method Detail |
|---|
public void reset()
public void start()
reset() and then starts the clock.
public void stop()
public Timecode getElapsed()
public boolean isRunning()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||