cpu使用率最高的进程名

编程入门 行业动态 更新时间:2024-10-27 04:31:07
本文介绍了cpu使用率最高的进程名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有一个 Samurize 配置,它显示类似于任务管理器的 CPU 使用率图表.

I have a Samurize config that shows a CPU usage graph similar to Task manager.

如何同时显示当前 CPU 使用百分比最高的进程名称?

How do I also display the name of the process with the current highest CPU usage percentage?

我希望每秒最多更新一次.Samurize 可以调用命令行工具并将其输出显示在屏幕上,因此这也是一种选择.

I would like this to be updated, at most, once per second. Samurize can call a command line tool and display it's output on screen, so this could also be an option.

进一步说明:

我研究过编写自己的命令行 c# .NET 应用程序来枚举从 System.Diagnostics.Process.GetProcesses() 返回的数组,但 Process 实例类似乎不包含 CPU 百分比属性.

I have investigated writing my own command line c# .NET application to enumerate the array returned from System.Diagnostics.Process.GetProcesses(), but the Process instance class does not seem to include a CPU percentage property.

我可以用某种方式计算吗?

Can I calculate this in some way?

推荐答案

使用 PowerShell:

With PowerShell:

Get-Process | Sort-Object CPU -desc | Select-Object -first 3 | Format-Table CPU,ProcessName -hidetableheader

返回有点像:

16.8641632 System 12.548072 csrss 11.9892168 powershell

更多推荐

cpu使用率最高的进程名

本文发布于:2023-11-16 16:50:34,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1606096.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:率最高   进程   cpu

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!