TPTP 4.6.0 Platform Project
Public API Specification

org.eclipse.hyades.execution.core.timer
Class PerformanceTimer

java.lang.Object
  extended by org.eclipse.hyades.execution.core.timer.PerformanceTimer
All Implemented Interfaces:
IPerformanceTimer

public class PerformanceTimer
extends java.lang.Object
implements IPerformanceTimer

A lightweight performance timer to be used for quick situations where approximate timing of a given algorithm or code is required. This class keeps a pool of identified timers, retrieve timers based on identity using the getInstance(...) method.


Method Summary
 void elapsed()
          Calculates and then uses the elapsed time details, average is computed for cases where the nested count is greater than zero
 void elapsed(int size)
          Calculates and then uses the elapsed time details, average is computed for cases where the nested count is greater than zero
static IPerformanceTimer getInstance(java.lang.String name)
          Retrieve the specified named instance of the performance timer
static IPerformanceTimer getInstance(java.lang.String name, java.io.PrintStream stream)
          Retrieve the specified name instance of the performance timer using the specified stream as the output destination
 void reset()
          Resets the performance timer attributes of a given performance timer instance
 void start()
          Starts a performance timer task with no task name given, a nested FILO scheme is used, the when the stop method is called the most recently started timer task is stopped
 void start(java.lang.String name)
          Starts a performance timer task with a the given task name used, uses a FILO approach, first timer task started in the last stop in order
 void stop()
          Stops the performance timer task, FILO approach, first timer task started is the last stopped, the performance timer keeps the memory
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static IPerformanceTimer getInstance(java.lang.String name)
Retrieve the specified named instance of the performance timer

Parameters:
name - the name of the instance to retrieve
Returns:
returns the named performance timer instance, created if it doesn't current exist

getInstance

public static IPerformanceTimer getInstance(java.lang.String name,
                                            java.io.PrintStream stream)
Retrieve the specified name instance of the performance timer using the specified stream as the output destination

Parameters:
name - the name of the instance to retrieve
stream - the stream to output to
Returns:
returns the appropriate performance timer, created if it doesn't current exist

elapsed

public void elapsed()
Description copied from interface: IPerformanceTimer
Calculates and then uses the elapsed time details, average is computed for cases where the nested count is greater than zero

Specified by:
elapsed in interface IPerformanceTimer

elapsed

public void elapsed(int size)
Description copied from interface: IPerformanceTimer
Calculates and then uses the elapsed time details, average is computed for cases where the nested count is greater than zero

Specified by:
elapsed in interface IPerformanceTimer
Parameters:
size - the size of the work completed within the elapsed time, the elapsed time will be divided by this number, for an indication of time per work unit

reset

public void reset()
Description copied from interface: IPerformanceTimer
Resets the performance timer attributes of a given performance timer instance

Specified by:
reset in interface IPerformanceTimer

start

public void start()
Description copied from interface: IPerformanceTimer
Starts a performance timer task with no task name given, a nested FILO scheme is used, the when the stop method is called the most recently started timer task is stopped

Specified by:
start in interface IPerformanceTimer

start

public void start(java.lang.String name)
Description copied from interface: IPerformanceTimer
Starts a performance timer task with a the given task name used, uses a FILO approach, first timer task started in the last stop in order

Specified by:
start in interface IPerformanceTimer
Parameters:
name - the named timer task to start

stop

public void stop()
Description copied from interface: IPerformanceTimer
Stops the performance timer task, FILO approach, first timer task started is the last stopped, the performance timer keeps the memory

Specified by:
stop in interface IPerformanceTimer

TPTP 4.6.0 Platform Project
Public API Specification