cv::TickMeter Class ReferenceCore functionality » Utility and system functions and macros
a Class to measure passing time. More...
#include <opencv2/core/utility.hpp>
Public Member Functions | |
a Class to measure passing time. More...
#include <opencv2/core/utility.hpp>
Public Member Functions | |
| TickMeter () |
| the default constructor |
| double | getAvgTimeMilli () const |
| returns average time in milliseconds |
| double | getAvgTimeSec () const |
| returns average time in seconds |
| int64 | getCounter () const |
| returns internal counter value. |
| double | getFPS () const |
| returns average FPS (frames per second) value. |
| double | getLastTimeMicro () const |
| returns passed time of the last iteration in microseconds. |
| double | getLastTimeMilli () const |
| returns passed time of the last iteration in milliseconds. |
| double | getLastTimeSec () const |
| returns passed time of the last iteration in seconds. |
| int64 | getLastTimeTicks () const |
| returns counted ticks of the last iteration. |
| double | getTimeMicro () const |
| returns passed time in microseconds. |
| double | getTimeMilli () const |
| returns passed time in milliseconds. |
| double | getTimeSec () const |
| returns passed time in seconds. |
| int64 | getTimeTicks () const |
| returns counted ticks. |
| void | reset () |
| resets internal values. |
| void | start () |
| starts counting ticks. |
| void | stop () |
| stops counting ticks. |
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();
cout << "Total time: " << tm.getTimeSec() << endl;It is also possible to compute the average time over multiple runs:
TickMeter tm;
for (int i = 0; i < COUNT; i++)
{
tm.start();
// do something ...
tm.stop();
cout << "Last iteration: " << tm.getLastTimeSec() << endl;
}
cout << "Average time per iteration in seconds: " << tm.getAvgTimeSec() << endl;
cout << "Average FPS: " << tm.getFPS() << endl;
| inline |
| Python: | ||||
|---|---|---|---|---|
| cv.TickMeter( | ) -> | <TickMeter object> |
the default constructor
| inline |
| Python: | ||||
|---|---|---|---|---|
| cv.TickMeter.getAvgTimeMilli( | ) -> | retval |
returns average time in milliseconds
| inline |
| Python: | ||||
|---|---|---|---|---|
| cv.TickMeter.getAvgTimeSec( | ) -> | retval |
returns average time in seconds
| inline |
| Python: | ||||
|---|---|---|---|---|
| cv.TickMeter.getCounter( | ) -> | retval |
returns internal counter value.
| inline |
| Python: | ||||
|---|---|---|---|---|
| cv.TickMeter.getFPS( | ) -> | retval |
returns average FPS (frames per second) value.
| inline |
| Python: | ||||
|---|---|---|---|---|
| cv.TickMeter.getLastTimeMicro( | ) -> | retval |
returns passed time of the last iteration in microseconds.
| inline |
| Python: | ||||
|---|---|---|---|---|
| cv.TickMeter.getLastTimeMilli( | ) -> | retval |
returns passed time of the last iteration in milliseconds.
| inline |
| Python: | ||||
|---|---|---|---|---|
| cv.TickMeter.getLastTimeSec( | ) -> | retval |
returns passed time of the last iteration in seconds.
| inline |
| Python: | ||||
|---|---|---|---|---|
| cv.TickMeter.getLastTimeTicks( | ) -> | retval |
returns counted ticks of the last iteration.
| inline |
| Python: | ||||
|---|---|---|---|---|
| cv.TickMeter.getTimeMicro( | ) -> | retval |
returns passed time in microseconds.
| inline |
| Python: | ||||
|---|---|---|---|---|
| cv.TickMeter.getTimeMilli( | ) -> | retval |
returns passed time in milliseconds.
| inline |
| Python: | ||||
|---|---|---|---|---|
| cv.TickMeter.getTimeSec( | ) -> | retval |
| inline |
| Python: | ||||
|---|---|---|---|---|
| cv.TickMeter.getTimeTicks( | ) -> | retval |
returns counted ticks.
| inline |
| Python: | ||||
|---|---|---|---|---|
| cv.TickMeter.reset( | ) -> | None |
resets internal values.
| inline |
| Python: | ||||
|---|---|---|---|---|
| cv.TickMeter.start( | ) -> | None |
starts counting ticks.
| inline |
| Python: | ||||
|---|---|---|---|---|
| cv.TickMeter.stop( | ) -> | None |
stops counting ticks.