41
Tips & Tricks / Re: CPU Meter
« Last post by Patrice Terrier on July 08, 2024, 06:16:49 pm »This is version 2.00.
It has been reworked to match the CPU processor percentage computation used in Windows 11.
On previous Windows 10, they were using "Processor(_Total)\\% Processor Time"
The solution is to use PDH (Performance Data Helper) and the Processor Utility request
nStatus = PdhAddEnglishCounter(cpuQuery, L"\\Processor Information(_Total)\\% Processor Utility", NULL, &cpuTotal);
\\Processor Information(_Total)\\% Processor Utility
The project use TCLib.lib to produce a tiny 29 Kb binary executable.
It has been reworked to match the CPU processor percentage computation used in Windows 11.
On previous Windows 10, they were using "Processor(_Total)\\% Processor Time"
The solution is to use PDH (Performance Data Helper) and the Processor Utility request
nStatus = PdhAddEnglishCounter(cpuQuery, L"\\Processor Information(_Total)\\% Processor Utility", NULL, &cpuTotal);
\\Processor Information(_Total)\\% Processor Utility
- Description: This counter measures the percentage of processor utility across all processors.
- Utility: It provides a more detailed and modern view of processor usage, taking into account various factors like the efficiency of processing and modern CPU architectures.
- Availability: This counter is generally available on newer systems with modern processors. It can give a more accurate representation of CPU utilization in multi-core and hyper-threaded environments.
- Description: This counter measures the percentage of time the processor is busy executing a non-idle thread.
- Utility: It is a more traditional counter that has been available in Windows for a long time. It reflects the CPU load by measuring the active time versus the idle time of the CPU.
- Availability: This counter is widely available across different versions of Windows and provides a consistent measure of CPU usage.
The project use TCLib.lib to produce a tiny 29 Kb binary executable.

Recent Posts

