pub fn calculate_offset_delay(
t1: &NtpTimestamp,
t2: &NtpTimestamp,
t3: &NtpTimestamp,
t4: &NtpTimestamp,
) -> NtpMeasurementExpand description
Calculate clock offset and round-trip delay from NTP timestamps.
Using the standard NTP formulas (all in milliseconds):
- offset = ((t2 - t1) + (t3 - t4)) / 2
- delay = (t4 - t1) - (t3 - t2)
Where:
- t1 = client transmit time (origin)
- t2 = server receive time
- t3 = server transmit time
- t4 = client receive time