Class Stopwatch
java.lang.Object
org.apache.druid.java.util.common.Stopwatch
Wrapper over
Stopwatch to provide some utility
methods such as millisElapsed(), restart(), hasElapsed(Duration).-
Method Summary
Modifier and TypeMethodDescriptionstatic Stopwatchstatic StopwatchcreateStarted(com.google.common.base.Ticker ticker) static StopwatchbooleanhasElapsed(org.joda.time.Duration duration) Checks if the given duration has already elapsed on the stopwatch.booleanhasNotElapsed(org.joda.time.Duration duration) Checks that the given duration has not elapsed on the stopwatch.booleanlongReturns the milliseconds elapsed on the stopwatch.voidreset()voidrestart()Invokesreset().start()on the underlyingStopwatch.voidstart()voidstop()
-
Method Details
-
createStarted
-
createUnstarted
-
createStarted
-
start
public void start() -
stop
public void stop() -
reset
public void reset() -
restart
public void restart()Invokesreset().start()on the underlyingStopwatch. -
isRunning
public boolean isRunning() -
millisElapsed
public long millisElapsed()Returns the milliseconds elapsed on the stopwatch. -
hasElapsed
public boolean hasElapsed(org.joda.time.Duration duration) Checks if the given duration has already elapsed on the stopwatch. -
hasNotElapsed
public boolean hasNotElapsed(org.joda.time.Duration duration) Checks that the given duration has not elapsed on the stopwatch. Calling this method is the same as!stopwatch.hasElapsed(duration).
-