Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

【Windows】 process.Percent > 100 #1752

Closed
1 task
Nyx2022 opened this issue Nov 27, 2024 · 3 comments
Closed
1 task

【Windows】 process.Percent > 100 #1752

Nyx2022 opened this issue Nov 27, 2024 · 3 comments
Labels

Comments

@Nyx2022
Copy link

Nyx2022 commented Nov 27, 2024

Describe the bug
in windows, process.Percent > 100

image

Expected behavior
get the value show in explorer, may be a litlle difference

Environment (please complete the following information):

  • Windows: [Microsoft Windows [ver 10.0.26100.2454]]

Additional context

@little-nil
Copy link

cpuPercentProcess, _ := proc.Percent(0)
cpuCount, _ := cpu.Counts(false)
cpuPercentProcess / float64(cpuCount)

@hitzhangjie
Copy link

hitzhangjie commented Mar 8, 2025

Yes, you should divide the number of cpus to get the value of single cpu

@Nyx2022
Copy link
Author

Nyx2022 commented Mar 8, 2025

ok,thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants