Class TickMeter


  • public class TickMeter
    extends java.lang.Object
    a Class to measure passing time. The class computes passing time by counting the number of ticks per second. That is, the following code computes the execution time in seconds: TickMeter tm; tm.start(); // do something ... tm.stop(); std::cout << tm.getTimeSec(); It is also possible to compute the average time over multiple runs: TickMeter tm; for (int i = 0; i < 100; i++) { tm.start(); // do something ... tm.stop(); } double average_time = tm.getTimeSec() / tm.getCounter(); std::cout << "Average time in second per iteration is: " << average_time << std::endl; SEE: getTickCount, getTickFrequency
    • Field Detail

      • nativeObj

        protected final long nativeObj
    • Constructor Detail

      • TickMeter

        protected TickMeter​(long addr)
      • TickMeter

        public TickMeter()
    • Method Detail

      • getNativeObjAddr

        public long getNativeObjAddr()
      • __fromPtr__

        public static TickMeter __fromPtr__​(long addr)
      • getTimeMicro

        public double getTimeMicro()
        returns passed time in microseconds.
        Returns:
        automatically generated
      • getTimeMilli

        public double getTimeMilli()
        returns passed time in milliseconds.
        Returns:
        automatically generated
      • getTimeSec

        public double getTimeSec()
        returns passed time in seconds.
        Returns:
        automatically generated
      • getCounter

        public long getCounter()
        returns internal counter value.
        Returns:
        automatically generated
      • getTimeTicks

        public long getTimeTicks()
        returns counted ticks.
        Returns:
        automatically generated
      • reset

        public void reset()
        resets internal values.
      • start

        public void start()
        starts counting ticks.
      • stop

        public void stop()
        stops counting ticks.
      • finalize

        protected void finalize()
                         throws java.lang.Throwable
        Overrides:
        finalize in class java.lang.Object
        Throws:
        java.lang.Throwable