43 #include <boost/date_time/posix_time/posix_time.hpp>
62 StopWatch () : start_time_ (boost::posix_time::microsec_clock::local_time ())
73 boost::posix_time::ptime end_time = boost::posix_time::microsec_clock::local_time ();
74 return (static_cast<double> (((end_time - start_time_).total_milliseconds ())));
88 start_time_ = boost::posix_time::microsec_clock::local_time ();
92 boost::posix_time::ptime start_time_;
114 title_ (std::string (title))
116 start_time_ = boost::posix_time::microsec_clock::local_time ();
120 title_ (std::string (
""))
122 start_time_ = boost::posix_time::microsec_clock::local_time ();
128 std::cerr << title_ <<
" took " << val <<
"ms.\n";
136 #ifndef MEASURE_FUNCTION_TIME
137 #define MEASURE_FUNCTION_TIME \
138 ScopeTime scopeTime(__func__)
144 boost::posix_time::ptime epoch_time (boost::gregorian::date (1970, 1, 1));
145 boost::posix_time::ptime current_time = boost::posix_time::microsec_clock::local_time ();
146 return (static_cast<double>((current_time - epoch_time).total_nanoseconds ()) * 1.0e-9);
151 #define DO_EVERY_TS(secs, currentTime, code) \
153 static double s_lastDone_ = 0.0; \
154 double s_now_ = (currentTime); \
155 if (s_lastDone_ > s_now_) \
156 s_lastDone_ = s_now_; \
157 if ((s_now_ - s_lastDone_) > (secs)) { \
159 s_lastDone_ = s_now_; \
167 #define DO_EVERY(secs, code) \
168 DO_EVERY_TS(secs, pcl::getTime(), code)
174 #endif //#ifndef PCL_NORMS_H_