public class StopWatch
extends java.lang.Object
Constructor and Description |
---|
StopWatch()
Initialize the new instance with default values.
|
Modifier and Type | Method and Description |
---|---|
static StopWatch |
createAndStart()
Returns a newly created and immediately started StopWatch.
|
long |
getDuration()
Returns the duration between start and stop in milliseconds.
|
void |
reset()
Resets the watch to a state before it gets started
|
long |
start()
Starts the stop watch.
|
long |
stop()
Stops the stop watch.
|
public static StopWatch createAndStart()
public long start()
public long stop()
public long getDuration()
stop()
has not been called yet it returns the duration from
start to now.public void reset()