discussion forum



message

Name: fcpuid
eMail: fcpuid@ifrance.com
Date: October 01, 2003 at 06:12:55
Subject: Re: Question about RDTSC programming
In Reply To: Re: Question about RDTSC programming by
unknown on October 01, 2003 at 01:31:28
Text: |||| To calculate the CPU speed you need to use the 8254 timer (ports 40h-43h)
|||| It has a resolution of 838ns and is the same on all PCs and has been so
|||| since the original IBM PC. Depending on what you're doing you might want
|||| to just use the 8254 timer in your game engine.
||||
|||| The link points to Intel's CPUID document which includes code to calculate
|||| the CPU speed. Getting the bus speed and multiplier involves reading MSRs
|||| and is different between processor families. You shouldn't really need that
|||| info anyway in a game engine.
||||
|||
||| Hey thanks for getting back to me, I will look into that doc. Ya I shouldnt need to access the MSR but i thought I could get the speed by Bus x multiplier but if this way works thats great. How accurate is it? Thanks
|||
|| Using the 8254 timer and RDTSC to time a small sequence of code is very
|| accurate. You can accurately calculate CPU speed to at least 0.1 Mhz,
|| probably 0.01 Mhz.
||
|
| Does the method in the document you gave me a link to utilize 8245? I dont see any referance to it. I cant seem to find any article specific to this timer over at intels page. If it isnt utilized in that doc do you have any sources that would have information it it? Thanks
|

Hi,

The MSR method report a false frequency if the processor is overclocked because you read original FSB and not 'actual' FSB.

I confirm that RDTSC is very accurate.

Regards.

optional link: http://membres.lycos.fr/fcpuid



post a followup message
(Be nice... or be blocked. Be technical... or be erased.)

Name: optional link title:
eMail: optional link URL:
Subject: optional image URL:
  Insert line breaks by hand when only about one inch remains at the right side. Otherwise your message will be unreadable.
Text:
 

  Note: The above eMail form fields may look unaligned if you are using a browser other than Netscape Navigator version 3.0.



currently posted followup messages
(You may have to press the RELOAD button of your browser.)




main page