Class CPUTimer


  • public class CPUTimer
    extends java.lang.Object
    class for cpu time measurements
    • Constructor Detail

      • CPUTimer

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

      • getName

        public java.lang.String getName()
        Returns:
        the name
      • add

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

        public void setName​(java.lang.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 java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
        Returns:
        See Also:
        Object.toString()
      • getSingleSummary

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

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

        public void println()
        simple print utility for lazy folks