Class TimingWithResult<R>

    • Field Detail

      • result

        public final R result
        The result of the operation performed
    • Constructor Detail

      • TimingWithResult

        public TimingWithResult​(R result,
                                String description,
                                Duration duration)
        Create a new TimingWithResult
        Parameters:
        result - The result of the operation performed
        description - Description of the timing - typically a description of what was timed/measured
        duration - How long did the operation performed take
      • TimingWithResult

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

      • of

        public static <R> TimingWithResult<R> of​(R result,
                                                 String description,
                                                 Duration duration)
        Create a new TimingWithResult
        Type Parameters:
        R - the type of result
        Parameters:
        result - The result of the operation performed
        description - Description of the timing - typically a description of what was timed/measured
        duration - How long did the operation performed take
        Returns:
        the TimingWithResult
      • of

        public static <R> TimingWithResult<R> of​(R result,
                                                 Duration duration)
        Create a new TimingWithResult
        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 TimingWithResult
      • getResult

        public R getResult()
        The result of the operation performed
        Returns:
        The result of the operation performed