- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
How can an application get CPU (only Core 2 Duo) frequency ? I tried the method with __rtdsc but the results are different every time I run the application. Reading frequency from Brand String is not satisfactory for me --I assume that user's CPU can be overclocked. Is there an MSR register or other way for getting current CPU frequency or FSB frequency?
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You don't indicate what OS you want to do this under. If the answer is Windows, try using QueryPerformanceFrequency (see http://msdn2.microsoft.com/en-us/library/bb173458.aspx).
On Linux, try looking in /proc/cpuinfo (see http://lwn.net/Articles/162548/).
--Robert
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am seeing a possibly related problem with performance measurement by rdtsc on Core 2 Duo. When running a short benchmark, starting with an idle machine (CPU speed throttled way back), the number of "clock ticks" reported by rdtsc comes out significantly lower. If anything, the actual elapsed time has to be higher, but I can't measure it accurately. If the test is repeated 5 seconds later, it comes out normal.
When Demand Based Switching was introduced on Pentium D, we were sometimes advised to disable DBS (possibly a BIOS setup option) in order to avoid these anomalous results, by keeping CPU at full speed regardless of load. I wouldn't want to do that on a machine as hot as a full speed Pentiurm D.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
![](/skins/images/D2683F18326913BBA0436CB7114DD569/responsive_peak/images/icon_anonymous_message.png)
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page