You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I wrote a simple program to send a NTP request to a local NTP server. The problem I found is that the client_time_receive is before originate_timestamp most of the time. If I ran 5 times, it happens 4 times.
Here's one of the output where client_time_receive is before originate_timestamp.
require'net/ntp'LOCAL_HOST='localhost'# measure NTP metrics by sending an NTP request to local hostdefmeasureresp=Net::NTP.get(LOCAL_HOST)puts"Complete NTP request:\n\toriginate_timestamp=#{resp.originate_timestamp},\n\treceive_timestamp=#{resp.receive_timestamp},\n\ttransmit_timestamp=#{resp.transmit_timestamp},\n\tclient_time_receive=#{resp.client_time_receive},\n\toffset=#{resp.offset}"puts"client_time_receive - originate_timestamp = #{resp.client_time_receive - resp.originate_timestamp}"endmeasure
I also print out the client_localtime in the get method and the originate_timestamp in the response object. They should be exactly same, but not. The originate_timestamp is usually greater than client_localtime for about 0.17 second.
The text was updated successfully, but these errors were encountered:
Hi, I wrote a simple program to send a NTP request to a local NTP server. The problem I found is that the
client_time_receive
is beforeoriginate_timestamp
most of the time. If I ran 5 times, it happens 4 times.Here's one of the output where
client_time_receive
is beforeoriginate_timestamp
.Code:
I also print out the client_localtime in the
get
method and the originate_timestamp in theresponse
object. They should be exactly same, but not. Theoriginate_timestamp
is usually greater thanclient_localtime
for about 0.17 second.The text was updated successfully, but these errors were encountered: