36 #ifndef PCL_CUDA_TIME_CPU_H_ 37 #define PCL_CUDA_TIME_CPU_H_ 45 # define WIN32_LEAN_AND_MEAN 49 # include <sys/time.h> 79 #ifndef MEASURE_FUNCTION_TIME 80 #define MEASURE_FUNCTION_TIME \ 81 ScopeTimeCPU scopeTime(__func__) 88 #define DO_EVERY_TS(secs, currentTime, code) \ 90 static double s_lastDone_ = 0.0; \ 91 double s_now_ = (currentTime); \ 92 if (s_lastDone_ > s_now_) \ 93 s_lastDone_ = s_now_; \ 94 if (s_now_ - s_lastDone_ > (secs)) { \ 96 s_lastDone_ = s_now_; \ 104 #define DO_EVERY(secs, code) \ 105 DO_EVERY_TS(secs, pcl::cuda::getTime(), code) 116 LARGE_INTEGER frequency;
117 LARGE_INTEGER timer_tick;
118 QueryPerformanceFrequency(&frequency);
119 QueryPerformanceCounter(&timer_tick);
120 return (
double)(timer_tick.QuadPart)/(
double)frequency.QuadPart;
122 timeval current_time;
123 gettimeofday (¤t_time, NULL);
124 return (current_time.tv_sec + 1e-6 * current_time.tv_usec);
136 double duration = end_time - start_time_;
137 std::cerr << title_ <<
" took " << 1000 * duration <<
"ms. " << std::endl;
140 #endif //#ifndef PCL_NORMS_H_
Class to measure the time spent in a scope.
ScopeTimeCPU(const char *title)