public class Stopwatch
extends java.lang.Object
Constructor and Description |
---|
Stopwatch()
Default constructor
|
Modifier and Type | Method and Description |
---|---|
long |
getElapsedMicros()
Returns the approximate total elapsed microsecond count
|
long |
getElapsedMillis()
Returns the approximate total elapsed millisecond count
|
long |
getElapsedNanos()
Returns the total elapsed nanosecond count.
|
long |
getElapsedSeconds()
Returns the approximate total elapsed second count
|
void |
reset()
Resets the total nanosecond count.
|
void |
restart()
Restarts the stop watch
|
void |
start()
Starts the stop watch.
|
static Stopwatch |
startNew()
Static instance creation method, returns a new started stopwatch
|
void |
stop()
Stops the stop watch
|
public static Stopwatch startNew()
public void start()
java.lang.IllegalStateException
- If the stop watch is started alreadypublic void stop()
java.lang.IllegalStateException
- If the stop watch is not stoppedpublic void reset()
public void restart()
public long getElapsedNanos()
public long getElapsedMicros()
public long getElapsedMillis()
public long getElapsedSeconds()