Class StopWatch
- java.lang.Object
-
- org.apache.qpid.protonj2.client.util.StopWatch
-
public final class StopWatch extends java.lang.ObjectA very simple stop watch.This implementation is not thread safe and can only time one task at any given time.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanisStarted()voidrestart()Starts or restarts the stop watchlongstop()Stops the stop watchlongtaken()Returns the time taken in millis.
-
-
-
Method Detail
-
isStarted
public boolean isStarted()
- Returns:
- check if the
StopWatchhas already been started.
-
restart
public void restart()
Starts or restarts the stop watch
-
stop
public long stop()
Stops the stop watch- Returns:
- the time taken in millis.
-
taken
public long taken()
Returns the time taken in millis.- Returns:
- time in millis
-
-