- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
A. To retrieve the current operating frequency and maximum operating frequency of a Pentium M processor, you should call the CallNtPowerInformation API under Windows* XP or Windows .NET* 2003. This will return a structure in the following format:
Message Edited by intel.software.network.support on 12-02-2005 08:48 PM
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
A followup Q&A, two years after the original post:
Q. I have been developing a tool which as a minor feature also displays the current CPU frequency. Previously this was done by reading the TSC before and after a short time interval and some calculations. This worked great, even on Banias and other frequency changing CPUs. Well... until the Conroe CPUs arrived.
Sadly I cannot use the TSC anymore on these processors since it is constantly increasing now, no matter what the actual frequency is.
Then I read this forum thread. And on some systems I could get it to work again. On some other systems... not. For example, my Pentium M notebook (which shows the correct clock using the TSC method) shows a constant clock in PROCESSOR_POWER_INFORMATION.
There are Conroe systems where neither method will work, which is very frustrating.
Now, my question is: Is there ONE possibility (without writing a driver) to get the current frequency which works on all processors?
A. You can either write WMI provider using Win32_Processor, use Perfmon formatted/raw counter programmatically, or even write a quick PDH query to get data from existing perfmon counters.
==
Lexi S.
IntelSoftware NetworkSupport
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Anotherengineer's responseto the last question:
You are not correctly taking into account power saving modes. Very likely you are measuring the frequency when the processor is in a lower power state, or your measurement time includes a period of time when you are coming out of that low power state.
Very likely you have BIOS configs that allow the processor to run at lower frequency when not loaded.
These transitions are now supported by newer operating systems -- they did not exist before. the method you describe for getting frequency will work. However, you need to be a bit more clever now. You can do something like this:
do 3 timesget start time and rdtsc
do something active (not sleep!) for 2 or 3 seconds-- do real computation here
get end time and rdtsc
If you print the values from each of these three attempts, you are likely to see a lower frequency the first time, and the correct frequency later times.
As a simpler solution, you might want to use the query_performance_counter from the OS instead of the timestamp counter.
==
Lexi S.
IntelSoftware NetworkSupport
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page