12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394 |
- #ifndef OPENCV_FLANN_TIMER_H
- #define OPENCV_FLANN_TIMER_H
- #include <time.h>
- #include "opencv2/core.hpp"
- #include "opencv2/core/utility.hpp"
- namespace cvflann
- {
- class StartStopTimer
- {
- int64 startTime;
- public:
-
- double value;
-
- StartStopTimer()
- {
- reset();
- }
-
- void start()
- {
- startTime = cv::getTickCount();
- }
-
- void stop()
- {
- int64 stopTime = cv::getTickCount();
- value += ( (double)stopTime - startTime) / cv::getTickFrequency();
- }
-
- void reset()
- {
- value = 0;
- }
- };
- }
- #endif
|