Comments re High resolution replacement for Sleep
#8
Couldn't work out why replacing the macro with the function didn't work.  Finally realised that I had to change /10^15 to *10^3 to get the correct values!

Took a bit of time to work out  that the issue was the macro substitution messing up the order of operations in the calculation.
The macro is not replacing CPUBaseFreq with the VALUE of 3.5*10^9, it is replacing it with the STRING  3.5*10^9 in  the source code, which resulted in a difference order of calculation and a vastly different magnitude of the result.

So qTime/CPUBaseFreq 
became
qTime/3.5*10^9

which is not the same as
qTime/(3.5*10^9)



(I guess the 10^15 was derived by trial and error since it has no logical basis when dividing tix by hertz Smile )
Reply


Messages In This Thread
RE: Comments re High resolution replacement for Sleep - by Stuart McLachlan - 09-14-2025, 06:41 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)