Class StopWatch
java.lang.Object
dk.cloudcreate.essentials.shared.time.StopWatch
Stop watch feature that allows you to time operations
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionelapsed()Return elapsed time as aDurationstatic StopWatchstart()Create a newStopWatchstatic StopWatchCreate a newStopWatchstop()Call this method to end the timing operationstatic DurationTime how long it takes to perform an operationstatic <R> TimingWithResult<R>Time how long it takes to perform an operation
-
Constructor Details
-
Method Details
-
start
Create a newStopWatch -
start
Create a newStopWatch -
stop
Call this method to end the timing operation- Returns:
- the
Timingresult
-
time
Time how long it takes to perform an operation- Parameters:
operation- the operation to perform- Returns:
- the time it took to perform the operation as a
Duration
-
time
Time how long it takes to perform an operation- Type Parameters:
R- The return type of the operation- Parameters:
operation- the operation to perform- Returns:
- the timing result (the result together with the time it took to perform the operation as a
Duration)
-
elapsed
Return elapsed time as aDuration- Returns:
- elapsed time as a
Duration
-