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:
cout <<
"Total time: " << tm.
getTimeSec() << endl;
a Class to measure passing time.
Definition: utility.hpp:295
void start()
starts counting ticks.
Definition: utility.hpp:304
double getTimeSec() const
returns passed time in seconds.
Definition: utility.hpp:339
void stop()
stops counting ticks.
Definition: utility.hpp:310
It is also possible to compute the average time over multiple runs:
for (int i = 0; i < COUNT; i++)
{
}
cout <<
"Average time per iteration in seconds: " << tm.
getAvgTimeSec() << endl;
cout <<
"Average FPS: " << tm.
getFPS() << endl;
double getFPS() const
returns average FPS (frames per second) value.
Definition: utility.hpp:351
double getAvgTimeSec() const
returns average time in seconds
Definition: utility.hpp:360
- See also
- getTickCount, getTickFrequency
- Examples
- samples/dnn/classification.cpp, and samples/dnn/object_detection.cpp.
◆ TickMeter()
cv::TickMeter::TickMeter |
( |
| ) |
|
|
inline |
◆ getAvgTimeMilli()
double cv::TickMeter::getAvgTimeMilli |
( |
| ) |
const |
|
inline |
returns average time in milliseconds
◆ getAvgTimeSec()
double cv::TickMeter::getAvgTimeSec |
( |
| ) |
const |
|
inline |
returns average time in seconds
◆ getCounter()
int64 cv::TickMeter::getCounter |
( |
| ) |
const |
|
inline |
returns internal counter value.
◆ getFPS()
double cv::TickMeter::getFPS |
( |
| ) |
const |
|
inline |
returns average FPS (frames per second) value.
◆ getTimeMicro()
double cv::TickMeter::getTimeMicro |
( |
| ) |
const |
|
inline |
returns passed time in microseconds.
◆ getTimeMilli()
double cv::TickMeter::getTimeMilli |
( |
| ) |
const |
|
inline |
◆ getTimeSec()
double cv::TickMeter::getTimeSec |
( |
| ) |
const |
|
inline |
returns passed time in seconds.
◆ getTimeTicks()
int64 cv::TickMeter::getTimeTicks |
( |
| ) |
const |
|
inline |
◆ reset()
void cv::TickMeter::reset |
( |
| ) |
|
|
inline |
◆ start()
void cv::TickMeter::start |
( |
| ) |
|
|
inline |
◆ stop()
void cv::TickMeter::stop |
( |
| ) |
|
|
inline |
The documentation for this class was generated from the following file: