public final class Stopwatch extends Object
| Constructor and Description |
|---|
Stopwatch()
Creates a new (unstarted)
Stopwatch. |
| Modifier and Type | Method and Description |
|---|---|
long |
elapsedTime()
Returns the current elapsed time, expressed in milliseconds.
|
boolean |
isRunning()
|
Stopwatch |
reset()
Resets this stopwatch (sets the elapsed time for this stopwatch to
zero).
|
Stopwatch |
start()
Starts this stopwatch.
|
Stopwatch |
stop()
Stops this stopwatch.
|
String |
toString() |
public boolean isRunning()
true if start() has been called on this
object, and stop() hasn't been called since the last call
to start().public Stopwatch start()
IllegalStateException - if this stopwatch is already running.public Stopwatch stop()
IllegalStateException - if this stopwatch is already stopped.public Stopwatch reset()
public long elapsedTime()
Copyright © 2012–2015. All rights reserved.