Paul
I don't like
CPUfreq = TSC/((cnt2-cnt1)/freq) ...... (1)
If we tidy that up we get
CPUfreq = k * freq where k = TSC/(cnt2-cnt1) ...... (2)
From your code
TSC = X + Execution time of QPC + TIX overhead
cnt2 - cnt1 = Execution time of TIX + X + QPC overhead
where X = Sleep 1000
The influence of the execution times and overheads diminishes as the time to execute X increases.
On my machine, freq = 2,666,880,000
Sleep 1000 => CPUfreq = 2,666,882,926
Sleep 10000 => CPUfreq = 2,666,880,292
Sleep 60000 => CPUfreq = 2,666,880,048
In maths jargon, as X tends to infinity CPUfreq tends to freq.
TIX overhead?
TIX TIXOverhead
TIX End TIXOverhead
on my machine gives TIXOverhead of 70 CPU cycles.
Unless my logic is up the 'Swanee', (1) is not the way to go to give a time element to TIX.
I'm looking at something else which seems to cast doubt on my using the frequency of the high resolution timer but I cannot quite get my head around the results yet.
I don't like
CPUfreq = TSC/((cnt2-cnt1)/freq) ...... (1)
If we tidy that up we get
CPUfreq = k * freq where k = TSC/(cnt2-cnt1) ...... (2)
From your code
TSC = X + Execution time of QPC + TIX overhead
cnt2 - cnt1 = Execution time of TIX + X + QPC overhead
where X = Sleep 1000
The influence of the execution times and overheads diminishes as the time to execute X increases.
On my machine, freq = 2,666,880,000
Sleep 1000 => CPUfreq = 2,666,882,926
Sleep 10000 => CPUfreq = 2,666,880,292
Sleep 60000 => CPUfreq = 2,666,880,048
In maths jargon, as X tends to infinity CPUfreq tends to freq.
TIX overhead?
TIX TIXOverhead
TIX End TIXOverhead
on my machine gives TIXOverhead of 70 CPU cycles.
Unless my logic is up the 'Swanee', (1) is not the way to go to give a time element to TIX.
I'm looking at something else which seems to cast doubt on my using the frequency of the high resolution timer but I cannot quite get my head around the results yet.

Comment