Package org.opencv.core
Class TickMeter
- java.lang.Object
-
- org.opencv.core.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 Summary
Fields Modifier and Type Field Description protected long
nativeObj
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static TickMeter
__fromPtr__(long addr)
protected void
finalize()
long
getCounter()
returns internal counter value.long
getNativeObjAddr()
double
getTimeMicro()
returns passed time in microseconds.double
getTimeMilli()
returns passed time in milliseconds.double
getTimeSec()
returns passed time in seconds.long
getTimeTicks()
returns counted ticks.void
reset()
resets internal values.void
start()
starts counting ticks.void
stop()
stops counting ticks.
-
-
-
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 classjava.lang.Object
- Throws:
java.lang.Throwable
-
-