Class TimingResult<R>

    • Field Detail

      • result

        public final R result
        The result of the operation performed
      • duration

        public final Duration duration
        How long did the operation performed take
    • Constructor Detail

      • TimingResult

        public TimingResult​(R result,
                            Duration duration)
        Create a new TimingResult
        Parameters:
        result - The result of the operation performed
        duration - How long did the operation performed take
    • Method Detail

      • of

        public static <R> TimingResult<R> of​(R result,
                                             Duration duration)
        Create a new TimingResult
        Type Parameters:
        R - the type of result
        Parameters:
        result - The result of the operation performed
        duration - 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