public class Stopwatch
extends java.lang.Object
Constructor | Description |
---|---|
Stopwatch() |
A stopped timer(! isRunning()) with 0msec accumulated time.
|
Modifier and Type | Method | Description |
---|---|---|
long |
getAccum() |
Return the total time in milliseconds that isRunning() has been true
since THIS was created or reset.
|
long |
getElapsed() |
Return the time in milliseconds since the latest, still-running
subtimer started.
|
int |
getRunning() |
Return the number of nested subtimers currently running.
|
boolean |
isRunning() |
Return true iff there are subtimers of THIS running.
|
void |
reset() |
Stop all subtimers, and set accumulated time to 0.
|
void |
start() |
Start a new subtimer at the current time.
|
long |
stop() |
Stops the most recently started, still-running subtimer, returning
the time elapsed since it started in milliseconds.
|
public Stopwatch()
public boolean isRunning()
public int getRunning()
public void start()
public long stop()
public long getElapsed()
public long getAccum()
public void reset()