列出所有进程及其当前存储兼; CPU的消耗? [英] List all processes and their current memory & CPU consumption?

查看:172
本文介绍了列出所有进程及其当前存储兼; CPU的消耗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我怎样才能在C#中,然后为每个进程当前的内存和CPU的消耗?

how can I get a list of all processes in C# and then for each process current memory and CPU consumption?

样品code是高度AP preciated。

Sample code is highly appreciated.

感谢您!

推荐答案

Process类有一个GetProcesses方法,可以让你列举正在运行的进程,并列出了一堆统计像内存使用情况和CPU时间。看看下面的统计特性的文档。

The Process class has a GetProcesses method that will let you enumerate the running processes and list a bunch of stats like memory usage and CPU time. Look at the documentation under properties for the stats.

内存使用是一个复杂的问题。实在是没有单号,描述了使用。请参阅Russinovich的优秀系列此事。第一期是在这里:<一href="http://blogs.technet.com/markrussinovich/archive/2008/07/21/3092070.aspx">http://blogs.technet.com/markrussinovich/archive/2008/07/21/3092070.aspx

Memory usage is a complex matter. There is really no single number, that describe the usage. Please see Russinovich's excellent series on the matter. The first installment is here: http://blogs.technet.com/markrussinovich/archive/2008/07/21/3092070.aspx

这篇关于列出所有进程及其当前存储兼; CPU的消耗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆