public class BasicStopwatch extends java.lang.Object implements Stopwatch
Constructor and Description |
---|
BasicStopwatch()
Create a new stopwatch with no associated timer.
|
Modifier and Type | Method and Description |
---|---|
long |
getDuration()
Returns the duration in nanoseconds.
|
long |
getDuration(java.util.concurrent.TimeUnit timeUnit)
Returns the duration in the specified time unit.
|
void |
reset()
Reset the stopwatch so that it can be used again.
|
void |
start()
Mark the start time.
|
void |
stop()
Mark the end time.
|
public BasicStopwatch()
public void reset()
public long getDuration(java.util.concurrent.TimeUnit timeUnit)
getDuration
in interface Stopwatch
public long getDuration()
getDuration
in interface Stopwatch