15 #ifndef NAV2_UTIL__EXECUTION_TIMER_HPP_
16 #define NAV2_UTIL__EXECUTION_TIMER_HPP_
27 using Clock = std::chrono::high_resolution_clock;
28 using nanoseconds = std::chrono::nanoseconds;
31 void start() {start_ = Clock::now();}
34 void end() {end_ = Clock::now();}
42 return std::chrono::duration<double>(end_ - start_).count();
46 Clock::time_point start_;
47 Clock::time_point end_;
Measures execution time of code between calls to start and end.
void start()
Call just prior to code you want to measure.
double elapsed_time_in_seconds()
Extract the measured time as a floating point number of seconds.
nanoseconds elapsed_time()
Extract the measured time as an integral std::chrono::duration object.
void end()
Call just after the code you want to measure.