cv::TickMeter Class Reference 核心功能 » 实用程序、系统函数及宏


a Class to measure passing time. 更多...

#include <opencv2/core/utility.hpp>

Public Member Functions

TickMeter ()
the default constructor 更多...
int64 getCounter () const
double getTimeMicro () const
double getTimeMilli () const
double getTimeSec () const
int64 getTimeTicks () const
void reset ()
void start ()
void stop ()

详细描述

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;
另请参阅
getTickCount , getTickFrequency
范例:
samples/dnn/object_detection.cpp .

Constructor & Destructor Documentation

TickMeter()

cv::TickMeter::TickMeter ( )
inline
Python:
<TickMeter object> = cv.TickMeter( )

the default constructor

成员函数文档编制

getCounter()

int64 cv::TickMeter::getCounter ( ) const
inline
Python:
retval = cv.TickMeter.getCounter( )

returns internal counter value.

getTimeMicro()

double cv::TickMeter::getTimeMicro ( ) const
inline
Python:
retval = cv.TickMeter.getTimeMicro( )

returns passed time in microseconds.

getTimeMilli()

double cv::TickMeter::getTimeMilli ( ) const
inline
Python:
retval = cv.TickMeter.getTimeMilli( )

returns passed time in milliseconds.

getTimeSec()

double cv::TickMeter::getTimeSec ( ) const
inline
Python:
retval = cv.TickMeter.getTimeSec( )

returns passed time in seconds.

getTimeTicks()

int64 cv::TickMeter::getTimeTicks ( ) const
inline
Python:
retval = cv.TickMeter.getTimeTicks( )

returns counted ticks.

reset()

void cv::TickMeter::reset ( )
inline
Python:
None = cv.TickMeter.reset( )

resets internal values.

start()

void cv::TickMeter::start ( )
inline
Python:
None = cv.TickMeter.start( )

starts counting ticks.

stop()

void cv::TickMeter::stop ( )
inline
Python:
None = cv.TickMeter.stop( )

stops counting ticks.


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