I think most of it is caused because the floating point calcs and the relatively long series of calls through which Now goes to get the date/time.
Just curious: What happens if you use the general function in Unix instead of the Linux "special"?
There were- as usual- two different things. The first was that in my function (head of this thread) I was dividing nSec by 10E9 rather than 1.0E9, that was causing both a disparity between the two ways of getting the time and occasional carry errors... I blush to admit how much difficulty I had finding that.
The second is a loss of precision as a timestamp progresses through the Now() function, I'm fairly confident that the low-level unix/Linux API is working properly.
I had a lot of hassle, even with 80-bit extended reals, with the order of some of the calculations.
One of the things I've revisited today is the resolution and what I call the "granularity" of the low-level RTC API. The particular Linux 4 kernel I'm running (which might have non-default configuration from Debian) claims a resolution of 1 nSec, but actually testing it shows a granularity of about 420 nSec.
Anyway, for the moment I'm back on comparing the timekeeping of this particular Arduino with what I'm getting from 60kHz MSF... the match is nowhere near as good as I'd like.
-----
Much later: the main chip, i.e. including timers etc., on an Arduino usually uses a resonator rather than a crystal, so the timing accuracy is in the % rather than the ppm range. I'm trying to characterise that.
A particular Arduino tells me that its idea of an hour is 3623.943 seconds. If I hook it onto an MSF receiver I should in principle have an atomic clock reference, I can see falling edges representing the start of seconds and the Arduino tells me that it thinks they're 993497 uSec apart. 3600/0.993497 = 3623.564 which is close enough to the other figure. I'd expect a PPS signal from a GPS receiver to work the same, although I trust MSF more. I've not started exploring variations against temperature.
I can't do this automatically yet, since I don't at present have a good external antenna mount and the signals are sufficiently bad that I'm having to be a bit selective. But this does demonstrate that it's possible to get at least one tertiary standard without having to go to a calibration lab.
MarkMLl