Class Timing

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

public class Timing extends Object
Utility for collecting timing information. Use startTimer(String) and stopTimer(String) to control when each named timer starts and stops. Timers with different names can be interleaved or nested, but two timers with the same name can not exist simultaneously.
  • Method Summary

    Modifier and Type
    Method
    Description
    static TabularData<org.apache.commons.lang3.tuple.Pair<String,org.apache.commons.math3.stat.descriptive.StatisticalSummary>>
    Returns the timing data in tabular format.
    static void
    Clears all timing data.
    static void
    Displays the collected timing data to standard output.
    static void
    Displays the collecting timing data.
    static org.apache.commons.math3.stat.descriptive.StatisticalSummary
    Returns the accumulated timing statistics for the timer with the specified name; or null if no such timer exists.
    static void
    Starts a timer with the specified name.
    static void
    Stops the timer with the specified name.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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; or null if no such timer exists.
      Parameters:
      name - the name of the timer
      Returns:
      the accumulated timing statistics for the timer with the specified name; or null if no such timer exists
    • clear

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

      public static TabularData<org.apache.commons.lang3.tuple.Pair<String,org.apache.commons.math3.stat.descriptive.StatisticalSummary>> 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