If the messages that you're sending have headers, you can set the timestamp in the header when the message is transmitted (if the timestamp isn't set already), and then in the callback on the other machine, you can compare that timestamp to the current time.
Originally posted by ahendrix with karma: 47576 on 2015-07-14
This answer was ACCEPTED on the original site
Post score: 0
Original comments
Comment by Saeid on 2015-07-15:
Thanks for your interest to answer me man. I am new in this staff. Can you please give some advise how to use this header. I googled but I understood nothing. Thanks
Comment by Saeid on 2015-07-15:
I found it, thanks
Comment by Den on 2022-03-28:
For completeness, most messages in ROS have a field called "stamp" of type "time" that is usually set to the time the message was published, see http://docs.ros.org/en/lunar/api/std_msgs/html/msg/Header.html for an example of this field. Therefore, a subscriber could subscribe to such a topic published from another machine and compare it to the current time now to see the delay for the message to be recieved.