跨平台的方式得到CPU /内存利用率 [英] Cross-Platform way to get CPU/Memory utilization

查看:244
本文介绍了跨平台的方式得到CPU /内存利用率的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

寻找一个在C库或相当跨平台的方法来获取CPU利用率,内存利用率等/ C ++。东西比其他的getrusage(),我需要整个系统,而不是一个过程。我检查左右,但并没有太大找到。我真的需要它在Linux,Mac OS X和Windows,但如果有针对* nix系统(包括OS X),但不能在Windows的解决方案,我可以解决的。

Looking for a library or a fairly cross platform method to get CPU utilization, memory utilization, etc in C/C++. Something OTHER than getrusage(), I need for entire system, not one process. I've checked around, but haven't found much. I really need it on Linux, Mac Os X, and Windows, but if there's a solution for *nix systems (including OS X) but not Windows, I can work around that.

如果一切都失败了,那么任何的方法来做到这一点对任何上述平台将是很好的了解,我可以弄清楚如何将它们打包喽!

If all else fails, then ANY methods to do this on ANY of the above platforms would be good to know, and I can figure out how to package them myself!

感谢

推荐答案

跨平台框架 ACE 有<一个包装HREF =htt​​p://www.dre.vanderbilt.edu/Doxygen/Micro/ace/a01964.html#ab633890ce8dc4935e5317974e852a08相对=nofollow>的getrusage ,应该在大多数,如果不是工作的所有支持的平台。

The cross platform framework ACE has a wrapper for getrusage that should work on most if not all supported platforms.

这篇关于跨平台的方式得到CPU /内存利用率的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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