Kyome22 / RunCat_for_windows

A cute running cat animation on your windows taskbar.
Apache License 2.0
6.47k stars 587 forks source link

Increased precision of the CPU utilization value #102

Closed airtaxi closed 2 years ago

airtaxi commented 2 years ago

Applied new PerformanceCounter parameter that matches the CPU usage value of the Windows Task Manager.

somnisomni commented 2 years ago

Good to reference: https://docs.microsoft.com/en-us/troubleshoot/windows-client/performance/cpu-usage-exceeds-100

The change made by @airtaxi in this PR will make the program use the value which reflects actual processor activity. I tested this in my forked repo and works great, so I recommend to merge this ;)

Kyome22 commented 2 years ago

@airtaxi Do you complete to work in this pull request?

airtaxi commented 2 years ago

@airtaxi Do you complete to work in this pull request?

Yes! it's completed

Kyome22 commented 2 years ago

I am not sure but I think it is great!

lynkas commented 1 year ago

new PerformanceCounter("Processor Information", "% Processor Utility", "_Total"); is way too not accurate on my machine, instead I got a more precise result (nearly same as task manager) by this: https://stackoverflow.com/a/46737880/8883824