|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.rice.cs.plt.debug.Stopwatch
public class Stopwatch
A simple timer based on System.currentTimeMillis(). To support better performance, this class
is not thread-safe.
| Constructor Summary | |
|---|---|
Stopwatch()
Create a new stopwatch with no split times and in a stopped state. |
|
Stopwatch(boolean startImmediately)
Create a new stopwatch with no split times; if startImmediately is true,
start the timer before returning. |
|
| Method Summary | |
|---|---|
long |
split()
Record and return the number of milliseconds since start() was invoked. |
Iterable<Long> |
splits()
Get a dynamically-updating view of all splits recorded by the stopwatch. |
void |
start()
Start the timer. |
long |
stop()
Stop the timer; record and return the number of milliseconds since start() was invoked. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Stopwatch()
public Stopwatch(boolean startImmediately)
startImmediately is true,
start the timer before returning.
| Method Detail |
|---|
public void start()
IllegalStateException - If the stopwatch is currently running.public long split()
start() was invoked.
IllegalStateException - If the stopwatch is not currently running.public long stop()
start() was invoked.
IllegalStateException - If the stopwatch is not currently running.public Iterable<Long> splits()
IterUtil.snapshot(java.lang.Iterable extends T>) if the stopwatch is to be used while iterating over
this list.)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||