ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Measure code/node running time

asked 2014-05-17 21:23:58 -0500

maysamsh gravatar image

I'm running amcl package for offline data and I want measure its running time, Is there something like MATLAB's tic and toc command?

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
2

answered 2014-05-17 22:11:39 -0500

Maya gravatar image

updated 2014-06-16 13:47:03 -0500

I'm not sure this is what you're looking for but Tic Toc in C++.

You could add in your amcl node.

EDIT : I had to use something similar myself and realize the link in made for windows. Here is what you're suppose to use on linux : Clock

edit flag offensive delete link more
6

answered 2018-01-29 15:19:06 -0500

vacky11 gravatar image

updated 2018-01-29 15:23:52 -0500

ros::WallTime can be used as follows

ros::WallTime start_, end_;

start_ = ros::WallTime::now();

// **** do something here... ****

end_ = ros::WallTime::now();

// print results
double execution_time = (end_ - start_).toNSec() * 1e-6;
ROS_INFO_STREAM("Exectution time (ms): " << execution_time);
edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2014-05-17 21:23:58 -0500

Seen: 4,886 times

Last updated: Jan 29 '18