Quote from PocketChange:
Each PC contains two clocks: "hardware clock" and the "software clock." The software clock runs when the PC is turned on and stops when the PC is turned off. The hardware clock uses a backup battery and continues to run even when the PC is turned off.
An Intel 8254 timer-counter (or functionally equivalent device) generates the software clock. This timer-counter generates an interrupt every 54.936 milliseconds, or about 18.2 times per second. The PC BIOS (basic input output system) contains a software routine that counts the interrupt requests and generates a time-of-day clock that can be read or set by other software programs. For example, the operating system might use the time-of-day information from the software clock to date and stamp files.
The software clock is a poor timekeeper. Any change in the interrupt-request rates causes the clock to gain or lose time. If the PC is left on for long periods of time, the software clock can be off by large amounts. A minute or more per day that the PC was left on is not an uncommon error rate. It is also possible for an ill-behaved software program to use the timer-counter for another purpose and change the interrupt rate. This could cause the software clock to rapidly gain or lose time.
The hardware clock is either a separate real-time clock or a RTC function integrated into the PC's chipset. The hardware clock is updated once per second and does not resolve to fractions of a second. Its timing accuracy is determined by the quality of the crystal oscillator it uses as its time base. A typical crystal has an initial frequency error of greater than ±20ppm, which will translate to greater than ±1.7 seconds per day. In actual operation, with temperature effects included, most hardware clocks gain or lose 5 to 15 seconds per day. As you can see, neither the software nor the hardware PC clock is suitable as an accurate timekeeping reference.
For higher time keeping reference systems sync to internet time servers using NTP protocol - RFC-1305. The time servers provides a data packet that includes a 64-bit time stamp containing the time in UTC seconds since January 1, 1900, with a resolution of 200 picoseconds. NTP provides accuracy of 1 to 50 milliseconds. NTP client software normally runs continuously and gets periodic updates from three or more independent servers.
The graph shows my server's system clock is +/- 50ms even when constantly synced to three independent ntp servers and CME's Time servers.