简体   繁体   English

如何检查应用程序的cpu使用情况(当然在应用程序内部)?

[英]How do I check my appplication's cpu usage (inside the app of course)?

Duplicate: How to get the CPU Usage in C#? 复制: 如何获得C#中的CPU使用率?


I have an application that is displaying stuff in real time. 我有一个实时显示内容的应用程序。 However, when the feed is giving too much info, my app will take up 100% of CPU. 但是,当提要提供的信息过多时,我的应用程序将占用100%的CPU。 Other stuff is running too so I don't want that to happen. 其他东西也在运行,所以我不希望这种情况发生。 I know I can avoid this by storing the incoming data in some data structure and pushing it to the black box calculation class. 我知道我可以通过将传入的数据存储在某种数据结构中并将其推送到黑盒计算类中来避免这种情况。 Looks like the black box doesn't mind volume but minds frequency. 看起来黑盒子不在乎音量,在乎频率。 But this compromises the timeliness of the information I am displaying. 但这损害了我显示的信息的及时性。

I'm thinking of getting the app to monitor its own CPU and adjust accordingly. 我正在考虑让该应用程序监视其自己的CPU并进行相应的调整。 Is this possible? 这可能吗?

I'm developing in C#. 我正在用C#开发。

Thanks! 谢谢!

I found it here . 我在这里找到的。

Somehow I always find it after. 我总是以某种方式找到它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM