NTP-client icon indicating copy to clipboard operation
NTP-client copied to clipboard

Millisecond precision not used

Open charbonneaua opened this issue 1 year ago • 0 comments

It looks like the milliseconds timestamp returned by the request_time method does not return millisecond precision because the packet.transmited_timestamp_sec_frac is not used.

See: https://github.com/plusangel/NTP-client/blob/787247efced6ef5d00e2817dd945857c029a45df/src/ntp_client.cpp#L122

Proposed fix:

double milliseconds = (double)txTm * 1000l + (((double)packet.transmited_timestamp_sec_frac/(double)UINT32_MAX) * 1000.0);

charbonneaua avatar Apr 24 '24 14:04 charbonneaua