37 #ifndef MOVEIT_PROFILER_ 38 #define MOVEIT_PROFILER_ 40 #define MOVEIT_ENABLE_PROFILING 1 42 #ifndef MOVEIT_ENABLE_PROFILING 48 #define MOVEIT_ENABLE_PROFILING 0 50 #define MOVEIT_ENABLE_PROFILING 1 55 #if MOVEIT_ENABLE_PROFILING 60 #include <boost/thread.hpp> 61 #include <boost/noncopyable.hpp> 62 #include <boost/date_time/posix_time/posix_time.hpp> 166 static void Event(
const std::string& name,
const unsigned int times = 1)
172 void event(
const std::string& name,
const unsigned int times = 1);
175 static void Average(
const std::string& name,
const double value)
181 void average(
const std::string& name,
const double value);
184 static void Begin(
const std::string& name)
190 static void End(
const std::string& name)
196 void begin(
const std::string& name);
199 void end(
const std::string& name);
204 static void Status(std::ostream& out = std::cout,
bool merge =
true)
212 void status(std::ostream& out = std::cout,
bool merge =
true);
242 : total(0, 0, 0, 0), shortest(
boost::posix_time::pos_infin), longest(
boost::posix_time::neg_infin), parts(0)
247 boost::posix_time::time_duration
total;
264 start = boost::posix_time::microsec_clock::universal_time();
270 const boost::posix_time::time_duration& dt = boost::posix_time::microsec_clock::universal_time() -
start;
297 std::map<std::string, unsigned long int>
events;
300 std::map<std::string, AvgInfo>
avg;
303 std::map<std::string, TimeInfo>
time;
309 std::map<boost::thread::id, PerThread>
data_;
365 static void Start(
void)
369 static void Stop(
void)
373 static void Clear(
void)
389 static void Event(
const std::string&,
const unsigned int = 1)
393 void event(
const std::string&,
const unsigned int = 1)
397 static void Average(
const std::string&,
const double)
401 void average(
const std::string&,
const double)
405 static void Begin(
const std::string&)
409 static void End(
const std::string&)
413 void begin(
const std::string&)
417 void end(
const std::string&)
421 static void Status(std::ostream& = std::cout,
bool =
true)
425 void status(std::ostream& = std::cout,
bool =
true)
Main namespace for MoveIt!