Skip to main content

ntp_now

Function ntp_now 

Source
pub fn ntp_now() -> u64
Expand description

Now, as a 64-bit NTP timestamp: seconds in the high half, fraction in the low half.

A clock that has never been set gives a time near the Unix epoch, which becomes an NTP timestamp in 1970 — wrong, but consistently wrong, and the round-trip calculation below works on differences of these, so a constant offset cancels. What would not cancel is a clock that steps mid-call, which is why round-trip times are reported as a most recent sample rather than accumulated into an average.