Posted by John Haine on 05/02/2023 14:51:47:
Dave, don't despair, those errors could be in part due to NTP wandering at your location…
**LINK**
I thought that worth investigating and set up a server program on a raspberryPi3B that responds to network requests by returning the Pi's NTP time.
The Pi is connected by Wifi to my router.
I wrote a client for my workstation that asks the Pi for NTP time every second, and timestamps the reply. The workstation is directly connected to the router with a cable, so is one layer closer to atomic time than the Pi.
The log looks like this:
Pi Time___________ Workstation Time____ Difference
1675617302.9517045 1675617302.9547412 -0.0030367374420166016
1675617303.9578679 1675617303.9608333 -0.0029654502868652344
1675617304.9659832 1675617304.9672174 -0.001234292984008789
In the example, the two NTP times differ by about 3 milliseconds, but the graph shows wilder excursions and that the Pi and Workstation clocks drift apart, until a correction occurs (marked Resync):

Mean difference between the two NTP sources is -4.15mS, including network delay of about +5mS. But the clocks are quite noisy, at one point over half a second apart, and they drift slowly apart until one or both resynchronises with an NTP server on the internet. So NTP is good, mostly almost always considerably better than 100mS, but far from perfect. A good chunk of the errors are likely due to both computers multi-processing, causing delays if either happens to be busy doing something else.
Anyway, it appears John is right. Very likely some of my troubles may are caused by NTP and the Linux computers I'm using – neither is real-time. I did say at the outset that NTP was good on average, but not sub-second reliable.
Dave