fixed possibly inccorrect interval measurements in flann's timer (bug #1165). Note: this may break binary compatibility, but since the class is not wrapped in Java and not exposed in Windows API, for example (it's considered internal-use class for flann), the effect should be minimal
This commit is contained in:
parent
354a5f2686
commit
d72cc06b96
@ -32,7 +32,7 @@
|
|||||||
#define OPENCV_FLANN_TIMER_H
|
#define OPENCV_FLANN_TIMER_H
|
||||||
|
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
#include "opencv2/core/core.hpp"
|
||||||
|
|
||||||
namespace cvflann
|
namespace cvflann
|
||||||
{
|
{
|
||||||
@ -44,7 +44,7 @@ namespace cvflann
|
|||||||
*/
|
*/
|
||||||
class StartStopTimer
|
class StartStopTimer
|
||||||
{
|
{
|
||||||
clock_t startTime;
|
int64 startTime;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/**
|
/**
|
||||||
@ -66,7 +66,7 @@ public:
|
|||||||
*/
|
*/
|
||||||
void start()
|
void start()
|
||||||
{
|
{
|
||||||
startTime = clock();
|
startTime = cv::getTickCount();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -74,8 +74,8 @@ public:
|
|||||||
*/
|
*/
|
||||||
void stop()
|
void stop()
|
||||||
{
|
{
|
||||||
clock_t stopTime = clock();
|
int64 stopTime = cv::getTickCount();
|
||||||
value += ( (double)stopTime - startTime) / CLOCKS_PER_SEC;
|
value += ( (double)stopTime - startTime) / cv::getTickFrequency();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user