org.mmtk.utility.statistics
Class Timer

java.lang.Object
  extended by org.mmtk.utility.statistics.Counter
      extended by org.mmtk.utility.statistics.LongCounter
          extended by org.mmtk.utility.statistics.Timer

public class Timer
extends LongCounter

This class implements a simple timer.


Field Summary
 
Fields inherited from class org.mmtk.utility.statistics.LongCounter
totalCount
 
Fields inherited from class org.mmtk.utility.statistics.Counter
complex
 
Constructor Summary
Timer(String name)
          Constructor
Timer(String name, boolean start)
          Constructor
Timer(String name, boolean start, boolean mergephases)
          Constructor
 
Method Summary
protected  long getCurrentValue()
          Get the current value for this timer
(package private)  double getTotalMillis()
          Get the current value of the timer in milliseconds
(package private)  void printMicro(long value)
          Print a value in microseconds
(package private)  void printMillis(long value)
          Print a value in milliseconds
(package private)  void printSecs(long value)
          Print a value in seconds
(package private)  void printTotalMicro()
          Print the total in microseconds
 void printTotalMillis()
          Print the total in milliseconds
 void printTotalSecs()
          Print the total in seconds
(package private)  void printValue(long value)
          Print a value (in milliseconds)
 
Methods inherited from class org.mmtk.utility.statistics.LongCounter
getLastTotal, phaseChange, printCount, printMax, printMin, printTotal, printTotal, start, stop
 
Methods inherited from class org.mmtk.utility.statistics.Counter
getColumnSuffix, getName, getStart, isComplex, mergePhases, printLast
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Timer

public Timer(String name)
Constructor

Parameters:
name - The name to be associated with this counter

Timer

public Timer(String name,
             boolean start)
Constructor

Parameters:
name - The name to be associated with this counter
start - True if this counter is to be implicitly started when startAll() is called (otherwise the counter must be explicitly started).

Timer

public Timer(String name,
             boolean start,
             boolean mergephases)
Constructor

Parameters:
name - The name to be associated with this counter
start - True if this counter is to be implicitly started when startAll() is called (otherwise the counter must be explicitly started).
mergephases - True if this counter does not separately report GC and Mutator phases.
Method Detail

getCurrentValue

protected final long getCurrentValue()
Get the current value for this timer

Specified by:
getCurrentValue in class LongCounter
Returns:
The current value for this timer

printTotalMicro

final void printTotalMicro()
Print the total in microseconds


printTotalMillis

public final void printTotalMillis()
Print the total in milliseconds


printTotalSecs

public final void printTotalSecs()
Print the total in seconds


printValue

final void printValue(long value)
Print a value (in milliseconds)

Overrides:
printValue in class LongCounter
Parameters:
value - The value to be printed

printMicro

final void printMicro(long value)
Print a value in microseconds

Parameters:
value - The value to be printed

printMillis

final void printMillis(long value)
Print a value in milliseconds

Parameters:
value - The value to be printed

printSecs

final void printSecs(long value)
Print a value in seconds

Parameters:
value - The value to be printed

getTotalMillis

final double getTotalMillis()
Get the current value of the timer in milliseconds