Package ej.benchmark

Class BenchResult


  • public class BenchResult
    extends Object
    Represents the results for a given test.
    • Field Detail

      • test

        public final BenchTest test
        The bench itself.
      • iterations

        public final int iterations
        The number of iterations the bench has been ran to reach the time specified in BenchTest.getRunTime().
      • emptyRunTime

        public final long emptyRunTime
        The time (for all iterations, in nanoseconds) to remove from fullTime in order to not accounted for extra work (see BenchTest).
      • fullTime

        public final long fullTime
        The bench time (for all iterations, in nanoseconds).
    • Constructor Detail

      • BenchResult

        public BenchResult​(BenchTest test,
                           int iterations,
                           long emptyRunTime,
                           long fullTime)
        Creates a bench result for the given bench.
        Parameters:
        test - the bench which has produced the results
        fullTime - the full bench time (in nanoseconds)
        emptyRunTime - the bench time to remove from fullTime (in nanoseconds)
        iterations - the number of iterations the bench has been ran.
    • Method Detail

      • getBenchTime

        public long getBenchTime()
        Gets the real bench time for one iteration removing the extra work time.
        Returns:
        the bench time in nanoseconds