Class TimingResult<R>
- java.lang.Object
-
- dk.cloudcreate.essentials.shared.time.TimingResult<R>
-
- Type Parameters:
R- the type of result
public class TimingResult<R> extends Object
The result ofStopWatch.time(Supplier)
-
-
Constructor Summary
Constructors Constructor Description TimingResult(R result, Duration duration)Create a newTimingResult
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description DurationgetDuration()How long did the operation performed takeRgetResult()The result of the operation performedstatic <R> TimingResult<R>of(R result, Duration duration)Create a newTimingResultStringtoString()
-
-
-
Constructor Detail
-
TimingResult
public TimingResult(R result, Duration duration)
Create a newTimingResult- Parameters:
result- The result of the operation performedduration- How long did the operation performed take
-
-
Method Detail
-
of
public static <R> TimingResult<R> of(R result, Duration duration)
Create a newTimingResult- Type Parameters:
R- the type of result- Parameters:
result- The result of the operation performedduration- How long did the operation performed take- Returns:
- the
TimingResult
-
getResult
public R getResult()
The result of the operation performed- Returns:
- The result of the operation performed
-
getDuration
public Duration getDuration()
How long did the operation performed take- Returns:
- How long did the operation performed take
-
-