How to get time for 1 looping program in ROS node ??
Hi ROS fans..
How to get time for 1 looping program in ROS node ??
I hope someone can help me ^_^
ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A answers.ros.org |
Hi ROS fans..
How to get time for 1 looping program in ROS node ??
I hope someone can help me ^_^
I am not sure exactly what you mean.
But if you want to know how many time does the loop you've written in a node last, you can use a time library.
I don't know about which library it is in C++, but in Python you can import 'time' and use the function 'clock()'. This function will return you the current date on your computer. Just call it at the beginning of the loop and have it printed in your terminal.
If you don't want to know the date but the time elapsed, just use a variable that your initialise once before the beginning of your loop and then, in your loop don't print 'clock()' value but clock() minus your initialised variable.
Hope that helps.
Please start posting anonymously - your entry will be published after you log in or create a new account.
Asked: 2013-05-30 20:46:28 -0600
Seen: 266 times
Last updated: May 30 '13
How to convert a timestamp from std::chrono::nanoseconds to ros::Time ?
Converting ros::Time to C++ string
ros::Walltime differs from chrono::clock?
Duration of 1 second during while(ros::ok())
What is the best way to determine the time it takes a service to return?
Why is header.stamp truncated as a C++ class member?
Will this Project be possible? / ROS Time Syncronisation
How exactly does ROS "Exact Time" policy work, for a time synchronizer?
Please edit your question, adding some pseudo-code showing what you want to measure.