Class Timing

java.lang.Object
org.moeaframework.util.Timing

public class Timing extends Object
Global timer for quickly measuring and displaying timing data.
  • Method Details

    • startTimer

      public static void startTimer(String name)
      Starts a timer with the specified name.
      Parameters:
      name - the name of the timer to start
    • stopTimer

      public static void stopTimer(String name)
      Stops the timer with the specified name.
      Parameters:
      name - the name of the timer to stop
    • getStatistics

      public static org.apache.commons.math3.stat.descriptive.StatisticalSummary getStatistics(String name)
      Returns the accumulated timing statistics for the timer with the specified name. If no timing data has been collected, returns an empty statistics object.
      Parameters:
      name - the name of the timer
      Returns:
      the accumulated timing statistics
    • clear

      public static void clear()
      Clears all timing data.
    • getOrCreate

      protected static Timer getOrCreate(String name)
      Gets or creates the timer with the given name.
      Parameters:
      name - the name of the timer
      Returns:
      the timer
    • asTabularData

      public static TabularData<Timer> asTabularData()
      Returns the timing data in tabular format.
      Returns:
      the tabular data
    • display

      public static void display()
      Displays the collected timing data to standard output.
    • display

      public static void display(PrintStream out)
      Displays the collecting timing data.
      Parameters:
      out - the stream for writing the timing data