Computer Clocks
December 14, 2004 8:55 AM   Subscribe

Why are computer clocks so BAD? I know about time sync programs, but why should I need one? Why can I get a watch in a Happy Meal that's only off by a second a year, but the clock in my fancy Pentium IV desktop loses a minute a week?
posted by bradhill to Computers & Internet (13 answers total)
 
It's likely because you are hooked up to a network and your workstation is synchronizing its clock with that of the server.
posted by ajr at 9:20 AM on December 14, 2004


There's this page about computers and clocks and this more readable Wired story. They both mention the heat that's built up inside the computer as something that will affect the quartz crystal.
posted by milkrate at 9:38 AM on December 14, 2004


Not an answer, but an anecdote about possibly the worst computer clock ever: my oooold Mac LC II's clock was so bad it started giving times and dates that didn't exist, like 25 o'clock on June 32, 2001. It was like it had been taken over by some late '60s psychedelic band from Haight-Ashbury.
posted by scody at 10:30 AM on December 14, 2004


That's a system software problem, not a clock problem. The clock chip only measures a number of seconds; the system software translates that into a date and time. Though I have to admit, I've never heard of a bug like that in those routines...
posted by mdeatherage at 10:39 AM on December 14, 2004


I agree, bradhill, that this is annoying. My main computer gains MINUTES per MONTH, which means that in a couple months it's wildy inaccurate if I don't keep fixing it. I eventually figured out how to run ntpd and it now stays synced to someone who is hopefully more precise than myself.

As to why it's this way? Maybe there's a good technical reason, but I think it's because motherboards are made as cheaply as possible. Every time I buy one I'm surprised at just how cheesy the whole thing is. Like, the poorly translated manual, the undocumented features, the buggy BIOS. A clock that gains / loses time just doesn't surprise me...
posted by knave at 10:46 AM on December 14, 2004


Your typical computer has two clocks. There's the hardware clock, which runs all the time on battery and tries to track the time. Then there's the software clock that the kernel maintains when the system is running. It starts by setting its time to the hardware clock, then maintains the time internally.

There are at least three sources of error in computer clocks.
  • Cheap parts. There's no market pressure for accurate clocks, so often the hardware clock is a piece of crap.
  • Environmental changes. Hardware clocks gain or lose time depending on temperature.
  • Software failures, particularly lost interrupts. This is the big one for your software clock. If your kernel has blocked interrupts because its writing a CD or something, it may lose the interrupt which says "update the clock". Dumb, but true.
If you've got a network connection, just run an NTP based clock synchronizer. WinXP and MacOS have this built in already, and it's trivial to set up on Linux.
posted by Nelson at 11:04 AM on December 14, 2004


My laptop loses anywhere from 5 to 10 minutes per week, even with Windows XP's time synch turned on... which has actually caused some semi-serious havoc.

Is there a way to make Windows update more frequently than once per week without an add-on utility?
posted by onshi at 11:55 AM on December 14, 2004


My main computer's clock matches the correct time when I boot it up, but within a day it's 20-30 minutes behind. I always assumed this was just a side-effect of it being a perpetually overtaxed Pentium 3 I bought several years ago.

I have no idea whether the clock is actually "worn-out" or if the idea is just so appealing as to preclude any other explanation.

scody - Brilliant! Reminds me of when I had one of those Chinese waving Chairman Mao watches; the mechanism was so crap that it ended up running backward for a couple of days. Then the minute hand fell off. The worst bit was that no amount of tinkering could get Mao to start waving again.
posted by Luther Blissett at 12:20 PM on December 14, 2004


I think the hardware clock can be affected by a lot of things, but primarily the voltage coming from the power supply/motherboard. If it expects a clean 12 volts but if it gets a voltage change the clock will change as it assumes 12 volts, or whatever it runs off of. Toss in spikes from booting up all the time and low quality of the BIOS clock and here we are.

At least thats how it was explained to me once.

Also, your computer has a pretty lousy random number generator and other cheap motherboard parts. Considering how competitive pricing is for motherboards you might be stuck with a lousy clock for a long time. People who work with random numbers or exact times buy high-end PCI cards with better clocks and a RNG (randon number generator) on them.

Atomic clock sync is a good free app to fix this. Windows supports NTP and if you double click the clock (windows XP SP2) and goto the internet time tab you can pick a time server and avoid using third-party apps like atomic.
posted by skallas at 1:00 PM on December 14, 2004


I'd get into heavy detail about PC clocks, but I'm neither qualified nor knowledgeable enough to really do that.

I can say this: Your PCs clock IC runs off an internal battery. Sometimes that will be the battery supplying power to keep your CMOS settings intact, or, in the case of a Dallas RTC, the battery is permanently built in.

If the battery is low, that could affect the time (usually to make it run slower). In the case of a Dallas RTC, that leaves you screwed unless you can solder and have spare parts. If it's just the battery, you should be able to replace that without any problem, although on REALLY old PCs this wasn't a socketed button cell, but rather a soldered on NiCd rechargeable (that would leak and destroy the motherboard).

Software can also affect the speed of the RTC. In the old DOS days, TSRs that hooked into the RTC interrupt (BIOS hook 70h, IIRC, and definately hardware IRQ 0/8) might speed it up or slow it down to suit the TSR (this would often mess with floppy disk access, too). Nowadays, I doubt any software does this. If you find the floppy drive on your PC is not functioning even after being replaced, well, now you know what it might be.

Overall, the PC RTC is governed by a 32.??? Khz crystal resonator, and therefore is pretty much EXACTLY as accurate as a dollar store watch, which uses the same mechanism to keep time.

HTH.
posted by shepd at 1:50 PM on December 14, 2004


In Windows XP, The clock update interval is stored in the registry key HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\TimeProviders\NtpClient in the value SpecialPollInterval. The number there is the update interval in seconds. Alternatively, InternetTime is a simple program that acts as an interface to this registry value.
posted by yarmond at 7:35 PM on December 14, 2004


As I understand it (and I'm no expert), the accuracy of the frequency generated by a quartz crystal is dependent on the temperature. The watch from your happy meal is probably very accurate as long as its crystal is kept close to body temperature -- which it will be whenever you're wearing the watch. Throw the same crystal into a computer, where you can expect huge temperature fluctuations, and it'll be much less accurate.

It should be pretty easy to test this theory: throw your happy meal watch into your computer case for a few weeks and see how accurate it is when you pull it out again...
posted by klausness at 7:48 PM on December 14, 2004


Thanks yarmond, that hits the spot.
posted by onshi at 9:45 PM on December 14, 2004


« Older How to make an updatable CD-Rom   |   Do people not experience side effects from SSRI... Newer »
This thread is closed to new comments.