Comment by snailmailman
3 years ago
I’ve recently gotten curious about how accurate my computers clock is, and the answer is “usually, only vaguely accurate down to one second”
I check via time.gov, and it’s often off by .5-.8s which just seems kinda insane to me. On my phone it’s always accurate to around .01s.
I think I have a guess as to why though. The bios clock might not save milliseconds[0]. So whenever I turn the computer on in the morning, it’s always not synced to the second. And windows just doesn’t care? Even if it’s off by 900ms and I manually go in and try to resync it often won’t bother. I have to manually change it to something blatantly wrong, then resync. And only then will it will finally be accurate to to .01s.
This seemingly default level of imprecision to nearly 1 full second is very surprising to me. I’m curious if that affects anything.
[0] not 100% certain about this. Maybe I just have insane second-per-day drift. I’ve seen the computer be off by as much as 1.3s, which doesn’t quite match my theory, but that error is enough to resync on its own.
I have not checked if in recent versions of Windows there has been any change, but previously by default the computer clock was synchronized with a time server only once per day, so until the next synchronization it is normal to accumulate a time difference up to one or two seconds.
I do not know how many Linux distributions enable by default a ntpd daemon, but I have always enabled it on any computer running Linux or FreeBSD.
When a ntpd is active, it adjusts continuously the local clock based on comparisons with NTP servers, so the time cannot be wrong by more than a few milliseconds. Therefore the error becomes 100 to 1000 times less than without ntpd.
The time differences between computers using NTP on the same LAN are smaller, usually of a few hundred microseconds. For even better synchronization within a LAN, the Precision Time Protocol must be used.
If you have systemd it enables a timesyncd service which is NTP.
To be precise, it's SNTP, not full-fledged NTP:
> The systemd-timesyncd service implements SNTP only. This minimalistic service will step the system clock for large offsets or slowly adjust it for smaller deltas. Complex use cases that require full NTP support (and where SNTP is not sufficient) are not covered by systemd-timesyncd.
1 reply →
It sounds like you may have your solution, but for linux users with similar concerns I'll note:
Not sure if it's available on Windows: `ntpd -g` can perform a big update on first check. https://serverfault.com/a/16513/513049
I was going to mention ntpdate, but in searching I've learned it's been deprecated for a decade, since September 2012, https://serverfault.com/a/16513/513049.