Loading...
Searching...
No Matches
cv::TickMeter Class Reference
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 | 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. | |
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;
double getTimeSec() const
returns passed time in seconds.
Definition: utility.hpp:339
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 << "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
Constructor & Destructor Documentation
◆ TickMeter()
|
inline |
the default constructor
Member Function Documentation
◆ getAvgTimeMilli()
|
inline |
returns average time in milliseconds
◆ getAvgTimeSec()
|
inline |
returns average time in seconds
◆ getCounter()
|
inline |
returns internal counter value.
◆ getFPS()
|
inline |
returns average FPS (frames per second) value.
◆ getTimeMicro()
|
inline |
returns passed time in microseconds.
◆ getTimeMilli()
|
inline |
returns passed time in milliseconds.
- Examples
- samples/dnn/classification.cpp.
◆ getTimeSec()
|
inline |
returns passed time in seconds.
◆ getTimeTicks()
|
inline |
returns counted ticks.
◆ reset()
|
inline |
resets internal values.
- Examples
- samples/dnn/classification.cpp.
◆ start()
|
inline |
starts counting ticks.
- Examples
- samples/dnn/classification.cpp.
◆ stop()
|
inline |
stops counting ticks.
- Examples
- samples/dnn/classification.cpp.
The documentation for this class was generated from the following file:
- opencv2/core/utility.hpp