user2017675
user2017675

Reputation: 1

NTP for latency

I would like to know if NTP can be used to measure latency between publishers and subscribers in a distributed computing environment. NTP is configured on all the nodes. I am able to collect statistics separately. How do I use NTP to measure latency accurately between the publisher and the s

Upvotes: 0

Views: 74

Answers (1)

Peter Lawrey
Peter Lawrey

Reputation: 533472

You can use NTP to synchronize the machines in a network. Then you use the local time i.e. System.currentTimeMillis() to get the time locally.

One way to make the timing easier is to send the time in the message. This way you can compare the time sent with the time received to get the latency.

Note: this is only accurate to milli-seconds. For greater accuracy you need special infrastructure.

Upvotes: 1

Related Questions