Package com.norconex.commons.lang.time
Class Timer
java.lang.Object
com.norconex.commons.lang.time.Timer
Time the execution of arbitrary code and return the elapsed time.
- Since:
- 3.0.0
-
Method Details
-
time
Returns the runnable execution time in milliseconds.- Parameters:
runnable- the code to execute- Returns:
- elapsed time in milliseconds
-
timeDuration
Returns the runnable execution time as aDuration.- Parameters:
runnable- the code to execute- Returns:
- elapsed time as
Duration
-
timeWatch
Returns the runnable execution time as a stoppedStopWatch.- Parameters:
runnable- the code to execute- Returns:
- elapsed time as a stopped
StopWatch
-