It is currently March 29th, 2024, 12:59 pm

Incorrect CPU measurements ??

Get help with creating, editing & fixing problems with skins
LooseAllTheMonies
Posts: 14
Joined: July 29th, 2021, 6:52 am

Incorrect CPU measurements ??

Post by LooseAllTheMonies »

Hey everyone,
I was working on a cpu meter and I noticed that Windows Task Manager, Rainmeter, and HWiNFO all report different CPU usage values, is it because of how they are calculated or where they get their info from? I'm not really sure who to trust here, Task Manager is pretty high at the moment and fans are blowing hard so im leaning towards believing the higher number reported by Task manager vs HWiNFO and Rainmeter (Processor=0). Is this possibly some type of bug?
Just looking for more info and a way to maybe hopefully get a more accurate reading.
Attached is just once example but they never really seem to match up, HWiNFO and RainMeter get pretty close most of the time but still pretty off from Task Manager.
cpudifference.jpg
Thanks!
You do not have the required permissions to view the files attached to this post.
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Incorrect CPU measurements ??

Post by jsmorley »

I have no real reason to doubt the accuracey of any of those methods. About the only advice I can give is to remember that any measurement of CPU is a snapshot in time, and a lot can very quickly change depending on what particular instant it was measured in. So any three tools you use to measure CPU will almost always give you three different results at any moment in time you view their results.

But I do note that the value in TaskManager, watched over time, is always a bit higher, perhaps double at some lower values, than it is in either Rainmeter or HWiNFO. Not sure why that would be, but then who knows what calculations Windows is using to "average" the core values. I often puzzled by information windows derives as raw data from PerfMon, then twists and shapes it to fit the kind of output that it wants to produce in TaskManager.

I find that either Rainmeter or HWiNFO have been fine for me for a long time. I don't pay much attention to TaskManager.
User avatar
Yincognito
Rainmeter Sage
Posts: 7029
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Incorrect CPU measurements ??

Post by Yincognito »

Two examples:
CPU1.jpg
CPU2.jpg
Up is Task Manager, down is the standard PerfMon.msc, in the middle is my little skin. Sometimes the measurement is closer to the Task Manager, sometimes to PerfMon. I might be wrong here, but it's possible that Task Manager has a different way of calculating that usage, with respect to the number of logical processors / cores one has. If I recall correctly, I saw some threads about this a while ago when googling... :???:
You do not have the required permissions to view the files attached to this post.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
SilverAzide
Rainmeter Sage
Posts: 2588
Joined: March 23rd, 2015, 5:26 pm

Re: Incorrect CPU measurements ??

Post by SilverAzide »

LooseAllTheMonies wrote: August 12th, 2021, 12:40 am Hey everyone,
I was working on a cpu meter and I noticed that Windows Task Manager, Rainmeter, and HWiNFO all report different CPU usage values, is it because of how they are calculated or where they get their info from? I'm not really sure who to trust here, Task Manager is pretty high at the moment and fans are blowing hard so im leaning towards believing the higher number reported by Task manager vs HWiNFO and Rainmeter (Processor=0). Is this possibly some type of bug?
Just looking for more info and a way to maybe hopefully get a more accurate reading.
Attached is just once example but they never really seem to match up, HWiNFO and RainMeter get pretty close most of the time but still pretty off from Task Manager.
Thanks!
Actually, all those sources do align once you realize where the data is coming from and how it is being reported. (I wondered about this, same as you.)

First, Rainmeter's CPU measure and the UsageMonitor plugin with the CPU alias, both pull the CPU usage from a source that uses a timed-based performance counter. If you look are PerfMon, this is the Processor > % Processor Time counter. HWiNFO and Windows 7's task manager also used this as well.

In Windows 8, Microsoft changed the way they measure "usage", because time-based monitoring doesn't mean as much when CPU's are automatically overclocking and underclocking. For example, if a CPU is running overclocked at 100%, it is doing WAY more work than if it was running 100% at the base clock speed. The time-based counters both report 100% in each mode, so Microsoft made a change.

In Windows 8 and later, a new performance counter was added, Processor Information > % Processor Utility. This counter better works with dynamically clocked cores to report the amount of work being done. Task Manager uses this new performance counter for "usage". In this case overclocked cores report 100+% performance, while underclocked cores will never get to 100% even if they are fully occupied. Unfortunately, it appears that Task Manager's overall utilization number is somehow being "un-scaled" and reports some weird value. If you look at the individual logical cores, the values will be correct, but the overall number is something different.

If you look at Windows' Resource Monitor (yet another info source), the top of the CPU pane shows "% CPU Usage" and "% Maximum Frequency". If you do the math (quickly!) you'll see that "% CPU Usage" x (100 / "%Maximum Frequency") will give you a number that more closely matches Rainmeter and HWiNFO. Something like that, I'm doing this from memory so I may have it backwards.

The important thing to note is all these numbers are "correct", it just depends how you want to measure "Usage".
Gadgets Wiki GitHub More Gadgets...
User avatar
Yincognito
Rainmeter Sage
Posts: 7029
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Incorrect CPU measurements ??

Post by Yincognito »

SilverAzide wrote: August 12th, 2021, 1:52 amIn Windows 8 and later, a new performance counter was added, Processor Information > % Processor Utility. This counter better works with dynamically clocked cores to report the amount of work being done. Task Manager uses this new performance counter for "usage".
Should have remembered this from the last time we talked about it. Didn't check it in this case, but I believe you're spot on.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
LooseAllTheMonies
Posts: 14
Joined: July 29th, 2021, 6:52 am

Re: Incorrect CPU measurements ??

Post by LooseAllTheMonies »

SilverAzide wrote: August 12th, 2021, 1:52 am Actually, all those sources do align once you realize where the data is coming from and how it is being reported. (I wondered about this, same as you.)

First, Rainmeter's CPU measure and the UsageMonitor plugin with the CPU alias, both pull the CPU usage from a source that uses a timed-based performance counter. If you look are PerfMon, this is the Processor > % Processor Time counter. HWiNFO and Windows 7's task manager also used this as well.

In Windows 8, Microsoft changed the way they measure "usage", because time-based monitoring doesn't mean as much when CPU's are automatically overclocking and underclocking. For example, if a CPU is running overclocked at 100%, it is doing WAY more work than if it was running 100% at the base clock speed. The time-based counters both report 100% in each mode, so Microsoft made a change.

In Windows 8 and later, a new performance counter was added, Processor Information > % Processor Utility. This counter better works with dynamically clocked cores to report the amount of work being done. Task Manager uses this new performance counter for "usage". In this case overclocked cores report 100+% performance, while underclocked cores will never get to 100% even if they are fully occupied. Unfortunately, it appears that Task Manager's overall utilization number is somehow being "un-scaled" and reports some weird value. If you look at the individual logical cores, the values will be correct, but the overall number is something different.

If you look at Windows' Resource Monitor (yet another info source), the top of the CPU pane shows "% CPU Usage" and "% Maximum Frequency". If you do the math (quickly!) you'll see that "% CPU Usage" x (100 / "%Maximum Frequency") will give you a number that more closely matches Rainmeter and HWiNFO. Something like that, I'm doing this from memory so I may have it backwards.

The important thing to note is all these numbers are "correct", it just depends how you want to measure "Usage".
Ahh, ok that clears things up, thank you very much!!