Class cv::TickMeter#
a Class to measure passing time. View details
#include <opencv2/core/utility.hpp>Collaboration diagram for cv::TickMeter:
Detailed Description#
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;
See also
- Examples
- samples/dnn/classification.cpp, and samples/dnn/object_detection.cpp.
Constructor & Destructor Documentation#
TickMeter()#
Python:
the default constructor
Member Function Documentation#
getAvgTimeMilli()#
double cv::TickMeter::getAvgTimeMilli()
Python:
cv.TickMeter.getAvgTimeMilli() -> retval
returns average time in milliseconds
getAvgTimeSec()#
double cv::TickMeter::getAvgTimeSec()
Python:
cv.TickMeter.getAvgTimeSec() -> retval
returns average time in seconds
getCounter()#
int64 cv::TickMeter::getCounter()
Python:
cv.TickMeter.getCounter() -> retval
returns internal counter value.
getFPS()#
double cv::TickMeter::getFPS()
Python:
cv.TickMeter.getFPS() -> retval
returns average FPS (frames per second) value.
getLastTimeMicro()#
double cv::TickMeter::getLastTimeMicro()
Python:
cv.TickMeter.getLastTimeMicro() -> retval
returns passed time of the last iteration in microseconds.
getLastTimeMilli()#
double cv::TickMeter::getLastTimeMilli()
Python:
cv.TickMeter.getLastTimeMilli() -> retval
returns passed time of the last iteration in milliseconds.
getLastTimeSec()#
double cv::TickMeter::getLastTimeSec()
Python:
cv.TickMeter.getLastTimeSec() -> retval
returns passed time of the last iteration in seconds.
Here is the call graph for this function:
getLastTimeTicks()#
int64 cv::TickMeter::getLastTimeTicks()
Python:
cv.TickMeter.getLastTimeTicks() -> retval
returns counted ticks of the last iteration.
getTimeMicro()#
double cv::TickMeter::getTimeMicro()
Python:
cv.TickMeter.getTimeMicro() -> retval
returns passed time in microseconds.
getTimeMilli()#
double cv::TickMeter::getTimeMilli()
Python:
cv.TickMeter.getTimeMilli() -> retval
returns passed time in milliseconds.
getTimeSec()#
double cv::TickMeter::getTimeSec()
Python:
cv.TickMeter.getTimeSec() -> retval
returns passed time in seconds.
Here is the call graph for this function:
getTimeTicks()#
int64 cv::TickMeter::getTimeTicks()
Python:
cv.TickMeter.getTimeTicks() -> retval
returns counted ticks.
reset()#
void cv::TickMeter::reset()
Python:
cv.TickMeter.reset()
resets internal values.
start()#
void cv::TickMeter::start()
Python:
cv.TickMeter.start()
starts counting ticks.
Here is the call graph for this function:
stop()#
void cv::TickMeter::stop()
Python:
cv.TickMeter.stop()
stops counting ticks.
Here is the call graph for this function:
Member Data Documentation#
counter#
int64 cv::TickMeter::counter
lastTime#
int64 cv::TickMeter::lastTime
startTime#
int64 cv::TickMeter::startTime
sumTime#
int64 cv::TickMeter::sumTime
Source file#
The documentation for this class was generated from the following file:
opencv2/core/utility.hpp