public final class StopWatch
extends java.lang.Object
Constructor and Description |
---|
StopWatch()
Create and start the stop watch.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
formattedToString() |
long |
nanoTicksPassed() |
void |
start()
Starts or restarts the watch.
|
long |
ticksPassed() |
double |
timePassed(TimeUnit unit)
Calculates and returns the time passed in the requested unit.
|
java.lang.String |
toString() |
public long ticksPassed()
ticksPassed
. In milliseconds or 10^-3 seconds.public long nanoTicksPassed()
ticksPassed
. In nanoseconds or 10^-9 seconds.public double timePassed(TimeUnit unit)
unit
- The requested time unit.public void start()
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String formattedToString()