Class PrecisionTimer


  • public class PrecisionTimer
    extends Object
    PrecisionTimer for measuring small time periods to estimate performance.
    • Constructor Detail

      • PrecisionTimer

        public PrecisionTimer()
    • Method Detail

      • start

        public long start()
      • start

        public long start​(long startTime)
      • update

        public long update()
      • stop

        public long stop()
      • reset

        public void reset()
      • getAvgIntervalNanoSeconds

        public long getAvgIntervalNanoSeconds()
      • getAvgIntervalMilliSeconds

        public long getAvgIntervalMilliSeconds()
      • getAvgIntervalSeconds

        public long getAvgIntervalSeconds()
      • getMaxIntervalNanoSeconds

        public long getMaxIntervalNanoSeconds()
      • getMaxIntervalMilliSeconds

        public long getMaxIntervalMilliSeconds()
      • getMaxIntervalSeconds

        public long getMaxIntervalSeconds()
      • getLastIntervalNanoSeconds

        public long getLastIntervalNanoSeconds()
      • getLastIntervalMilliSeconds

        public long getLastIntervalMilliSeconds()
      • getLastIntervalSeconds

        public long getLastIntervalSeconds()
      • getElapsedNanoSeconds

        public long getElapsedNanoSeconds()
        Returns the elapsed time in nanoseconds.
        Returns:
        the elapsed time (in nanoseconds).
      • getElapsedMilliSeconds

        public long getElapsedMilliSeconds()
        Returns the elapsed time in milliseconds.
        Returns:
        the elapsed time (in milliseconds).
      • getElapsedSeconds

        public long getElapsedSeconds()
        Returns the elapsed time in seconds.
        Returns:
        the elapsed time (in seconds).
      • getItemsPerSecond

        public double getItemsPerSecond​(long nItems)
      • getNanoSecondsPerItem

        public double getNanoSecondsPerItem​(long nItems)
      • getMicroSecondsPerItem

        public double getMicroSecondsPerItem​(long nItems)
      • getMilliSecondsPerItem

        public double getMilliSecondsPerItem​(long nItems)
      • getSecondsPerItem

        public double getSecondsPerItem​(long nItems)
      • getNanoSecondsPerItem

        public static double getNanoSecondsPerItem​(long elapsed,
                                                   long nItems)
      • getMicroSecondsPerItem

        public static double getMicroSecondsPerItem​(long elapsed,
                                                    long nItems)
      • getMilliSecondsPerItem

        public static double getMilliSecondsPerItem​(long elapsed,
                                                    long nItems)
      • getSecondsPerItem

        public static double getSecondsPerItem​(long elapsed,
                                               long nItems)