Class CPUTimer

java.lang.Object
org.cip4.jdflib.util.CPUTimer

public class CPUTimer extends Object
class for cpu time measurements
  • Constructor Details

    • CPUTimer

      public CPUTimer(boolean bStart)
      Parameters:
      bStart - if true, start measuring now
  • Method Details

    • getName

      public String getName()
      Returns:
      the name
    • add

      public void add(CPUTimer timer)
      add a timer to this
      Parameters:
      timer -
    • setName

      public void setName(String name)
      Parameters:
      name - the name to set
    • getTotalCPUTime

      public long getTotalCPUTime()
      method to get the amount of cpu time since construction
      Returns:
      amount of cpu time in nano seconds
    • getCurrentCPUTime

      public long getCurrentCPUTime()
      Returns:
    • getCreationTime

      public long getCreationTime()
      Returns:
      creation time in milliseconds (see System.currentTimeMillis());
    • getTotalRealTime

      public long getTotalRealTime()
      method to get the amount of real time since construction in milliseconds
      Returns:
      amount of real in milliseconds
    • getCurrentRealTime

      public long getCurrentRealTime()
      Returns:
      the current realtime im milliseconds
    • start

      public void start()
      start measuring times
    • stop

      public void stop()
      stop/pause measuring times
    • pause

      public void pause()
      stop/pause measuring times - decrement the number of start/stop so that we don't recount the next start
    • getNumStarts

      public long getNumStarts()
      Returns:
    • getAverageRealTime

      public long getAverageRealTime()
      Returns:
    • getAverageCPUTime

      public long getAverageCPUTime()
      Returns:
    • toString

      public String toString()
      Overrides:
      toString in class Object
      Returns:
      See Also:
    • getSingleSummary

      public String getSingleSummary()
      get a summary for a single run
      Returns:
    • toXML

      public KElement toXML()
      Returns:
      the XML representation of this
    • getFactory

      public static CPUTimer.CPUTimerFactory getFactory()
      Returns:
      the one and only CPUTimerFactory
    • println

      public void println()
      simple print utility for lazy folks