fixed calculation method of "cv::TickMeter"

This commit is contained in:
atinfinity 2014-06-07 07:29:22 +09:00
parent 9a5e9d3442
commit f08d88fa78

View File

@ -1209,16 +1209,16 @@ private:
cv::TickMeter::TickMeter() { reset(); } cv::TickMeter::TickMeter() { reset(); }
int64 cv::TickMeter::getTimeTicks() const { return sumTime; } int64 cv::TickMeter::getTimeTicks() const { return sumTime; }
double cv::TickMeter::getTimeMicro() const { return (double)getTimeTicks()/cvGetTickFrequency(); } double cv::TickMeter::getTimeSec() const { return (double)getTimeTicks()/getTickFrequency(); }
double cv::TickMeter::getTimeMilli() const { return getTimeMicro()*1e-3; } double cv::TickMeter::getTimeMilli() const { return getTimeSec()*1e3; }
double cv::TickMeter::getTimeSec() const { return getTimeMilli()*1e-3; } double cv::TickMeter::getTimeMicro() const { return getTimeMilli()*1e3; }
int64 cv::TickMeter::getCounter() const { return counter; } int64 cv::TickMeter::getCounter() const { return counter; }
void cv::TickMeter::reset() {startTime = 0; sumTime = 0; counter = 0; } void cv::TickMeter::reset() {startTime = 0; sumTime = 0; counter = 0; }
void cv::TickMeter::start(){ startTime = cvGetTickCount(); } void cv::TickMeter::start(){ startTime = getTickCount(); }
void cv::TickMeter::stop() void cv::TickMeter::stop()
{ {
int64 time = cvGetTickCount(); int64 time = getTickCount();
if ( startTime == 0 ) if ( startTime == 0 )
return; return;