a Class to measure passing time.
More...
#include <opencv2/core/utility.hpp>
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:
tm.start();
tm.stop();
cout << "Total time: " << tm.getTimeSec() << endl;
TickMeter()
the default constructor
Definition: utility.hpp:329
It is also possible to compute the average time over multiple runs:
for (int i = 0; i < COUNT; i++)
{
tm.start();
tm.stop();
cout << "Last iteration: " << tm.getLastTimeSec() << endl;
}
cout << "Average time per iteration in seconds: " << tm.getAvgTimeSec() << endl;
cout << "Average FPS: " << tm.getFPS() << endl;
- See also
- getTickCount, getTickFrequency
- Examples
- samples/dnn/classification.cpp.
◆ TickMeter()
| cv::TickMeter::TickMeter |
( |
| ) |
|
|
inline |
| Python: |
|---|
| cv.TickMeter( | | ) -> | <TickMeter object> |
◆ getAvgTimeMilli()
| double cv::TickMeter::getAvgTimeMilli |
( |
| ) |
const |
|
inline |
| Python: |
|---|
| cv.TickMeter.getAvgTimeMilli( | | ) -> | retval |
returns average time in milliseconds
◆ getAvgTimeSec()
| double cv::TickMeter::getAvgTimeSec |
( |
| ) |
const |
|
inline |
| Python: |
|---|
| cv.TickMeter.getAvgTimeSec( | | ) -> | retval |
returns average time in seconds
◆ getCounter()
| int64 cv::TickMeter::getCounter |
( |
| ) |
const |
|
inline |
| Python: |
|---|
| cv.TickMeter.getCounter( | | ) -> | retval |
returns internal counter value.
◆ getFPS()
| double cv::TickMeter::getFPS |
( |
| ) |
const |
|
inline |
| Python: |
|---|
| cv.TickMeter.getFPS( | | ) -> | retval |
returns average FPS (frames per second) value.
◆ getLastTimeMicro()
| double cv::TickMeter::getLastTimeMicro |
( |
| ) |
const |
|
inline |
| Python: |
|---|
| cv.TickMeter.getLastTimeMicro( | | ) -> | retval |
returns passed time of the last iteration in microseconds.
◆ getLastTimeMilli()
| double cv::TickMeter::getLastTimeMilli |
( |
| ) |
const |
|
inline |
| Python: |
|---|
| cv.TickMeter.getLastTimeMilli( | | ) -> | retval |
returns passed time of the last iteration in milliseconds.
◆ getLastTimeSec()
| double cv::TickMeter::getLastTimeSec |
( |
| ) |
const |
|
inline |
| Python: |
|---|
| cv.TickMeter.getLastTimeSec( | | ) -> | retval |
returns passed time of the last iteration in seconds.
◆ getLastTimeTicks()
| int64 cv::TickMeter::getLastTimeTicks |
( |
| ) |
const |
|
inline |
| Python: |
|---|
| cv.TickMeter.getLastTimeTicks( | | ) -> | retval |
returns counted ticks of the last iteration.
◆ getTimeMicro()
| double cv::TickMeter::getTimeMicro |
( |
| ) |
const |
|
inline |
| Python: |
|---|
| cv.TickMeter.getTimeMicro( | | ) -> | retval |
returns passed time in microseconds.
◆ getTimeMilli()
| double cv::TickMeter::getTimeMilli |
( |
| ) |
const |
|
inline |
| Python: |
|---|
| cv.TickMeter.getTimeMilli( | | ) -> | retval |
◆ getTimeSec()
| double cv::TickMeter::getTimeSec |
( |
| ) |
const |
|
inline |
| Python: |
|---|
| cv.TickMeter.getTimeSec( | | ) -> | retval |
returns passed time in seconds.
◆ getTimeTicks()
| int64 cv::TickMeter::getTimeTicks |
( |
| ) |
const |
|
inline |
| Python: |
|---|
| cv.TickMeter.getTimeTicks( | | ) -> | retval |
◆ reset()
| void cv::TickMeter::reset |
( |
| ) |
|
|
inline |
| Python: |
|---|
| cv.TickMeter.reset( | | ) -> | None |
◆ start()
| void cv::TickMeter::start |
( |
| ) |
|
|
inline |
| Python: |
|---|
| cv.TickMeter.start( | | ) -> | None |
◆ stop()
| void cv::TickMeter::stop |
( |
| ) |
|
|
inline |
| Python: |
|---|
| cv.TickMeter.stop( | | ) -> | None |
The documentation for this class was generated from the following file: