Class QuickTime

java.lang.Object
com.github.gbenroscience.parser.turbo.QuickTime

public class QuickTime extends Object
Author:
GBEMIRO
  • Constructor Details

    • QuickTime

      public QuickTime()
  • Method Details

    • timeNano

      public static long timeNano(QuickTime.Timable task)
      Times a single execution of a method in nanoseconds. Note: Single runs are susceptible to JIT "cold" overhead. * @param task The logic to time.
      Returns:
      Execution time in nanoseconds.
    • benchmarkNano

      public static double benchmarkNano(String label, int warmups, int iterations, QuickTime.Timable task)
      Times a method over multiple iterations and returns the average. This is better for benchmarking ParserNG logic.
      Parameters:
      label -
      warmups - Number of times to run the task.
      iterations - Number of times to run the task.
      task - The logic to time.
      Returns:
      Average execution time in nanoseconds.
    • report

      public static void report(String label, QuickTime.Timable task)
      Prints a formatted report of the execution time.
      Parameters:
      label -
      task -