Unless all your nodes have synchronized clocks this would be near impossible to do. If you do have an accurate sync mechanism in place and can trust that the clocks are the same then you could just insert a timestamp into the packet when you send it from A and then in C you compare that to the current time.
But again, you need high res time sync for this approach to work.
What you could do if you just want to benchmark and get an idea of an average time is to make the packet bounce back. Basically, tell C to send the same packet back to B and then to A and in A you compare the original timestamp with the current time (which will be using the same clock). This will give you a round trip latency which you can divide by two to get one-way latency time.
If you are worried about the overhead added by sending messages back then you could do one (or both of) the following
- Send a much smaller packet back. Basically an integer corresponding to the sequence number of the received message
- Only send an ACK every Nth message. Should provide enough data to know "typical" latency time