Here is how unstable a PC RTC is compared to the QueryPerformanceCounter
The first number is number of microseconds that is off in the current tick
the second number is the average.
So in a thousand seconds it's 55 milliseconds off.
in a hundred thousand seconds it's 5.5 seconds off.
so in 27.777777777777777777777777777778 hours is 5.5 seconds off.
That' 1 day 3 hours 46 minutes and 40 seconds to drift 5.5 seconds.
Per day would be, 27.7(7) is to 5.5 like 24 is to X so, X = 24*5.5/27.7(7) = 4.752 seconds per day drift.
And look at how the seconds fluctuate (first value) it's horrible!
my PC seems to actually run slow on the RTC
second drift = -0.000055, total drift = -0.000055
second drift = -0.000056, total drift = -0.000055
second drift = -0.000055, total drift = -0.000055
second drift = -0.000054, total drift = -0.000055
second drift = -0.000055, total drift = -0.000055
second drift = -0.000055, total drift = -0.000055
second drift = -0.000056, total drift = -0.000055
second drift = -0.000054, total drift = -0.000055
second drift = -0.000056, total drift = -0.000055
second drift = -0.000055, total drift = -0.000055
second drift = -0.000054, total drift = -0.000055
second drift = -0.000056, total drift = -0.000055
second drift = -0.000055, total drift = -0.000055
second drift = -0.000031, total drift = -0.000053
second drift = -0.000079, total drift = -0.000055
second drift = -0.000056, total drift = -0.000055
second drift = -0.000054, total drift = -0.000055
second drift = -0.000055, total drift = -0.000055
second drift = -0.000056, total drift = -0.000055
second drift = -0.000048, total drift = -0.000055
second drift = -0.000062, total drift = -0.000055
second drift = -0.000051, total drift = -0.000055
second drift = -0.000059, total drift = -0.000055
second drift = -0.000052, total drift = -0.000055
second drift = -0.000060, total drift = -0.000055
second drift = -0.000046, total drift = -0.000055
second drift = -0.000063, total drift = -0.000055
second drift = -0.000055, total drift = -0.000055
second drift = -0.000054, total drift = -0.000055
second drift = -0.000057, total drift = -0.000055
second drift = -0.000043, total drift = -0.000055
second drift = -0.000067, total drift = -0.000055
second drift = -0.000055, total drift = -0.000055
second drift = -0.000055, total drift = -0.000055
second drift = -0.000055, total drift = -0.000055
second drift = -0.000055, total drift = -0.000055
second drift = -0.000056, total drift = -0.000055
second drift = -0.000055, total drift = -0.000055
second drift = -0.000055, total drift = -0.000055
second drift = -0.000056, total drift = -0.000055
second drift = -0.000030, total drift = -0.000055
second drift = -0.000080, total drift = -0.000055
second drift = -0.000054, total drift = -0.000055
second drift = -0.000056, total drift = -0.000055
second drift = -0.000054, total drift = -0.000055
second drift = -0.000055, total drift = -0.000055
second drift = -0.000057, total drift = -0.000055
second drift = 0.000122, total drift = -0.000051
second drift = -0.000232, total drift = -0.000055
second drift = -0.000055, total drift = -0.000055
second drift = -0.000055, total drift = -0.000055
second drift = -0.000055, total drift = -0.000055
second drift = -0.000055, total drift = -0.000055
second drift = -0.000055, total drift = -0.000055
second drift = -0.000056, total drift = -0.000055
second drift = -0.000055, total drift = -0.000055
second drift = -0.000056, total drift = -0.000055
second drift = -0.000054, total drift = -0.000055
second drift = -0.000056, total drift = -0.000055
second drift = -0.000050, total drift = -0.000055
second drift = -0.000060, total drift = -0.000055
second drift = -0.000055, total drift = -0.000055
second drift = -0.000043, total drift = -0.000055
second drift = -0.000067, total drift = -0.000055
second drift = -0.000055, total drift = -0.000055
second drift = -0.000054, total drift = -0.000055
second drift = -0.000056, total drift = -0.000055
Edit: granted, that jumping per second is probably due to aliasing due to the interrupt system that maintains the clock, but in any event the average clock is still off by 55 microseconds per second average.
Edit2: And thinking about it it might be that both are off, meaning the QPC and the RTC, the thing is the QPC keeps real time (even if a wrong time) the RTC oscillates a lot.
I could adjust the QPC to match the average RTC easily if that was giving a good clock in the long run. But I tend to trust the QueryPerformanceFrequency to actually give me the CPU clock, so I guess I would have to spend a full day with a chrono to check if the RTC is right or the QPC is right, or both are wrong!
No matter what, the average of the RTC is consistent with the QPC so there is hope!
I had the program running for almost 3 hours and the average is still 55 micro seconds per second
Edit3: So QueryPerformanceFrequency claims my CPU is 2,400,050,000 Hz (weird number because it's way too round).
If I adjust for the -0.000055 seconds per second and trust the average of the RTC then my CPU frequency is really: 2,399,917,997.25 Hz for a 2.4GHz rated system.
That looks more plausible, But no matter what the QPC doesn't jump up and down like the RTC. I will have to investigate further to see where in between the true time lies upon.
In the past I always used the average of the RTC to determine the actual frequency of the CPU when using the RDTSC, but since the introduction of the QueryPerformanceCounter and QueryPerformanceFrequency I did rely on that frequency instead. Maybe I should not.