MOEA Framework 2.12
API Specification

org.moeaframework.util
Class Timing

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

public class Timing
extends Object

Tool to simplify manually collecting timing information. Timers with different names can be interleaved or nested, but two timers with the same name can not exist simultaneously - the first timer with the shared name must be stopped before the second is started.

 for (int i=0; i<N; i++) {
   Timing.startTimer("foo");
   ...code for which we are collecting timing information...
   Timing.stopTimer("foo");
 }
 
 


Method Summary
static void clear()
          Clears all timing data.
static org.apache.commons.math3.stat.descriptive.SummaryStatistics getStatistics(String name)
          Returns the accumulated timing statistics for the timer with the specified name; or null if no such timer exists.
static void printMagnitudes()
          Prints the relative magnitudes of the collected timer data to the standard output stream.
static void printMagnitudes(PrintStream out)
          Prints the relative magnitudes of the collected timer data to the specified PrintStream.
static void printStatistics()
          Prints the collected timer data to the standard output stream.
static void printStatistics(PrintStream out)
          Prints the collected timer data to the specified PrintStream.
static void startTimer(String name)
          Starts a timer with the specified name.
static void stopTimer(String name)
          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 Detail

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.SummaryStatistics 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

printStatistics

public static void printStatistics()
Prints the collected timer data to the standard output stream.


printStatistics

public static void printStatistics(PrintStream out)
Prints the collected timer data to the specified PrintStream.

Parameters:
out - the stream to which data is printed

printMagnitudes

public static void printMagnitudes()
Prints the relative magnitudes of the collected timer data to the standard output stream.


printMagnitudes

public static void printMagnitudes(PrintStream out)
Prints the relative magnitudes of the collected timer data to the specified PrintStream.

Parameters:
out - the stream to which data is printed

clear

public static void clear()
Clears all timing data.


MOEA Framework 2.12
API Specification

Copyright 2009-2016 MOEA Framework. All rights reserved.
Licensed under the GNU Lesser General Public License.
Return to the MOEA Framework homepage. Visit us on Github!