OpenCV  4.1.1-pre
Open Source Computer Vision
Looking for a C++ dev who knows OpenCV?
I'm looking for work. Hire me!

a Class to measure passing time. More...

#include <opencv2/core/utility.hpp>

Public Member Functions

 TickMeter ()
 the default constructor More...
 
int64 getCounter () const
 returns internal counter value. More...
 
double getTimeMicro () const
 returns passed time in microseconds. More...
 
double getTimeMilli () const
 returns passed time in milliseconds. More...
 
double getTimeSec () const
 returns passed time in seconds. More...
 
int64 getTimeTicks () const
 returns counted ticks. More...
 
void reset ()
 resets internal values. More...
 
void start ()
 starts counting ticks. More...
 
void stop ()
 stops counting ticks. More...
 

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:

tm.start();
// do something ...
tm.stop();
std::cout << tm.getTimeSec();

It is also possible to compute the average time over multiple runs:

for (int i = 0; i < 100; i++)
{
tm.start();
// do something ...
tm.stop();
}
double average_time = tm.getTimeSec() / tm.getCounter();
std::cout << "Average time in second per iteration is: " << average_time << std::endl;
See also
getTickCount, getTickFrequency
Examples:
samples/dnn/object_detection.cpp.

Constructor & Destructor Documentation

◆ TickMeter()

cv::TickMeter::TickMeter ( )
inline

the default constructor

Member Function Documentation

◆ getCounter()

int64 cv::TickMeter::getCounter ( ) const
inline

returns internal counter value.

◆ getTimeMicro()

double cv::TickMeter::getTimeMicro ( ) const
inline

returns passed time in microseconds.

◆ getTimeMilli()

double cv::TickMeter::getTimeMilli ( ) const
inline

returns passed time in milliseconds.

◆ getTimeSec()

double cv::TickMeter::getTimeSec ( ) const
inline

returns passed time in seconds.

References cv::getTickFrequency().

Referenced by cv::operator<<().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getTimeTicks()

int64 cv::TickMeter::getTimeTicks ( ) const
inline

returns counted ticks.

◆ reset()

void cv::TickMeter::reset ( )
inline

resets internal values.

◆ start()

void cv::TickMeter::start ( )
inline

starts counting ticks.

References cv::getTickCount().

Here is the call graph for this function:

◆ stop()

void cv::TickMeter::stop ( )
inline

stops counting ticks.

References cv::getTickCount().

Here is the call graph for this function:

The documentation for this class was generated from the following file: