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

Revision history [back]

click to hide/show revision 1
initial version
ros::WallTime start, end;

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

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

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

// print results
double dur_ros = (e_ros - s_ros).toNSec() * 1e-6;

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 dur_ros execution_time = (e_ros (end - s_ros).toNSec() start).toNSec() * 1e-6;
ROS_INFO_STREAM("Exectution time (ms): " << execution_time);

ros::WallTime can be used as follows

ros::WallTime start, end;
start_, end_;
 start start_ = ros::WallTime::now();

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

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

// print results
double execution_time = (end (end_ - start).toNSec() start_).toNSec() * 1e-6;
ROS_INFO_STREAM("Exectution time (ms): " << execution_time);