The AM Forum
April 29, 2024, 01:24:50 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
 
   Home   Help Calendar Links Staff List Gallery Login Register  
Pages: [1]   Go Down
  Print  
Author Topic: How accurate is your computer clock?  (Read 7001 times)
0 Members and 1 Guest are viewing this topic.
k4kyv
Contributing Member
Don
Member

Offline Offline

Posts: 10057



« on: May 26, 2005, 12:42:28 PM »

My computer is set to automatically check internet time every day, and to reset the clock.  Otherwise it gets off a few seconds a day.  My previous Windows computer was much worse than this one- it lost about 5 minutes a week.  At work, we use Apple computers, and I have noticed the same thing- a couple of seconds a day.

I have two cheap Timex wrist watches that cost < $25 each.  Each one will stay within 5 seconds of WWV for a couple of months without resetting.

Why is it that a computer that costs > $1000 won't keep as good time as a cheap electronic wristwatch?

Unless I am missing something, the computer clock is ultimately based on a xtal-controlled time base oscillator, as is a "quartz" timepiece.  Why is it so difficult to maintain comparable precision in frequency on a xtal oscillator that happens to be mounted on a computer motherboard?
Logged

Don, K4KYV                                       AMI#5
Licensed since 1959 and not happy to be back on AM...    Never got off AM in the first place.

- - -
This message was typed using the DVORAK keyboard layout.
http://www.mwbrooks.com/dvorak
WA1GFZ
Member

Offline Offline

Posts: 11152



« Reply #1 on: May 26, 2005, 01:24:28 PM »

internal reference is drifting around because it isn't temperature compensated like a watch reference. BTW most of the time your watch is sitting at room temp or body temp.
My new dvd is great it gets the latest time off the cable so I don't have to look at flashing 12:00 for 6 months at a time.
Logged
WD8BIL
Contributing
Member
*
Offline Offline

Posts: 4410


« Reply #2 on: May 26, 2005, 01:36:48 PM »

Mine is close enough to get me to the dinner table on time !!!!
Logged
Paul, K2ORC
Contributing
Member
*
Offline Offline

Posts: 854


« Reply #3 on: May 26, 2005, 01:45:13 PM »

Quote from: WD8BIL
Mine is close enough to get me to the dinner table on time !!!!


Bud knows!  Only two times of the day you really need to know: when its time to eat and when it ain't.  And I'm never late for either.

Rancid

http://www.lares.dti.ne.jp/~yugo/storage/monocrafts_ver3/03/index.html
Logged

Go Duke![/b]
KE1GF
Guest
« Reply #4 on: May 26, 2005, 01:47:55 PM »

Don when you're talking about modern computers there are actually two clocks involved.

There is the hardware clock the "RTC" Real Time Clock and the system clock.

When the computer isn't running the hardware clock keeps time for the computer running off the battery installed on the mother-board.

When the system is booted the RTC is basically ignored and is used to throw interrupts to the operating system to perform involuntary context switches for processes back to the operating system's task scheduler, among other things too.

So usually when a system is booted the system clock of the operating system is synched with the hardware RTC and when the system is shutdown the RTC is synched back with the system clock.

ie:

On boot
RTC -> system clock

on shutdown
system clock -> RTC

Inevitably the arrival of this interrupt (IRQ) which returns control from processes back to the operating system and also updates the "system clock" from the hardware RTC is not perfect. The system clock either may race or lag behind what the actual "real time" is. There is a ton of reasons including but not limited to CPU stalls, integer errors in calculating the MIPS of the CPU (under Linux this is called bogoMIPS) or other amounts of time where the CPU is losing control of the system like DMA from hardware etc etc etc....

To drift from the main subject for a second, IRQ arrivals to the CPU are the basis for the entropy in a modern systems pseudo random number generator, ie Keyboard, Mouse, Harddisks, Network Interface etc. If this gives you any insight. Just like the "RTC"/"System Clock" The seed from the pseudo random number generator (enumerator) is loaded/stored on boot/shutdown. IRQ's from these devices cause context switches too... It's a complex machine running under the hood of your box.

The answer to solve this problem is to use a program that implements a version of the christian algorithim and use your internet connection to keep your machine synched to an atomic clock. The "NIST" National Institute of Standards and Technology http://www.nist.gov/ provides a time server on the internet and programs to keep your system in check. http://tf.nist.gov/service/its.htm

Christian's algorithim does a very good job keeping your computer's "System clock" accurate in which the explanation of how it does this is beyond the scope of this discussion.

Time drift is a real world problem for all of us in the computer industry, thus we run programs that keep all of our computers synched to a time server so that they're all running accurate time. This is a key necessity
to team software development when using concurrent repositories for versions source code. And the list goes on.

I hope this is sufficient explanation of why your computer clock is lousy and what to do about it.

I remember this question was very similar to an essay question that I had to answer for my distriubuted systems course, but I had to explain how Christian's algorithm actually worked.
Logged
Glenn K2KL
Guest
« Reply #5 on: May 26, 2005, 02:59:20 PM »

very cool link Paul!!!...  what a fast wrist!  Cool ... Bet he was a MelBay student!  :lol:  :lol:


http://www.lares.dti.ne.jp/~yugo/storage/monocrafts_ver3/03/index.html
Logged
VA3ES - Piss-Weak Ed
Guest
« Reply #6 on: May 30, 2005, 04:45:18 PM »

I use a little app that automatically looks up NIST every 15 minutes and synchs my clock.  I can choose from dozens of official time sources but have settled on NIST at Ft. Collins CO.  The app I use is called "D4" but there are lot's  of similar apps available.
Logged
Jeff 'OGM
Guest
« Reply #7 on: May 30, 2005, 05:41:28 PM »

Bill, I never knew that there was a system clock and a hardware clock that were separate, or that this trade-off took place at bootup.  Tnx for the detailed description of the problem.

...and how about when BSOD's or lockups occur?  Does that throw the clock(s) even further off?

Jeff
KA1OGM
Logged
Ian VK3KRI
Guest
ntp
« Reply #8 on: June 01, 2005, 08:19:51 AM »

Not sure about windows but on unix the 'ntp' (network time protocol)  daemon will discipline your local machine clock to external reference sources. Typically these sources  will be in turn synced to Cesuim, GPS CDMA  or even WWV reference clocks.  ntpd actually calculates and applies a continuos offset to the local clock using PLL type algorithms etc -and the main man of ntp is a ham   W3HCF.

Pentuim class processors inclue the 'TSC'  - Time Stamp Counter Register which increments  each clock cycle. This is used (in i586 Linux at least) as the master reference as to real time. ntp calculates a PPM offset to this and applies it multiple times a second.

Personally, at home, I run ntp to external reference sources and a local GPS as a local reference clock so I can keep the offset down to 10s of nano seconds . (Of course youre asking why bother and the answer is -  Because I can! )  The GPS also provides gating for my freq counter.

At work I have a number of geographically distributed machines whose target is <100uS difference between them - ntp to the rescue again.

I know simple NTP clients are available for windows that will tweak the time relative to an external ntp  source periodially but iI'm not sure if  a full impelmentations is available that will contunually discipline the local clock
                                                                       Ian VK3KRI
Logged
Jim, W5JO
Member

Offline Offline

Posts: 2508


« Reply #9 on: June 01, 2005, 10:23:05 AM »

With Windows XP one can choose to sync the clock to either the microsoft server, or NIST.  Click on the time down in bottom right corner of the toobar and the time setting window opens.  The last tab will allow you to choose.  My time seems to track the atomic clock setting by the computer pretty close.
Logged
Powell
Guest
« Reply #10 on: June 02, 2005, 10:06:19 AM »

I don't use the computer clock for telling time. I leave that to a REAL clock...a Telechron!!!!!

 Cheesy  Smiley  Shocked  Cool


Powell
Logged
Pages: [1]   Go Up
  Print  
 
Jump to:  

AMfone - Dedicated to Amplitude Modulation on the Amateur Radio Bands
 AMfone © 2001-2015
Powered by SMF 1.1.21 | SMF © 2015, Simple Machines
Page created in 0.057 seconds with 18 queries.