70 auto end_time = std::chrono::steady_clock::now();
71 return std::chrono::duration<double, std::ratio<1, 1000>>(end_time -
start_time_).count();
89 std::chrono::time_point<std::chrono::steady_clock>
start_time_;
118 std::cerr << title_ <<
" took " << val <<
"ms.\n";
144 : window_size_ (window_size)
146 stop_watch_.
reset ();
153 if (event_time_queue_.size () > window_size_)
154 event_time_queue_.pop ();
161 if (event_time_queue_.size () < 2)
163 return ((event_time_queue_.size () - 1) /
164 (event_time_queue_.back () - event_time_queue_.front ()));
170 stop_watch_.
reset ();
171 event_time_queue_ = std::queue<double> ();
177 std::queue<double> event_time_queue_;
178 const std::size_t window_size_;
182 #ifndef MEASURE_FUNCTION_TIME
183 #define MEASURE_FUNCTION_TIME \
184 ScopeTime scopeTime(__func__)
190 return std::chrono::duration<double>(std::chrono::system_clock::now().time_since_epoch()).count();
195 #define DO_EVERY_TS(secs, currentTime, code) \
197 static double s_lastDone_ = 0.0; \
198 double s_now_ = (currentTime); \
199 if (s_lastDone_ > s_now_) \
200 s_lastDone_ = s_now_; \
201 if ((s_now_ - s_lastDone_) > (secs)) { \
203 s_lastDone_ = s_now_; \
211 #define DO_EVERY(secs, code) \
212 DO_EVERY_TS(secs, pcl::getTime(), code)