I would like to measure the ping time between a sender process and a consumer.
Both processes run on the same physical host, Linux 64 bit.
I'm currently using clock_gettime(CLOCK_REALTIME, &cur_ts);
.
I basically capture the current timestamp cur_ts
and send it to consumer process; as soon as it's being received on the other end I then invoke clock_gettime(CLOCK_REALTIME, &cur_ts);
again in the second process and subtract the two times.
Is this procedure accurate to measure ping between two processes? Should I be using something different?
Thanks