问题描述
寻找一个在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!
感谢
推荐答案
的 有的getrusage ,应该在大多数,如果不是工作的所有支持的平台。
The cross platform framework ACE has a wrapper for getrusage that should work on most if not all supported platforms.
这篇关于跨平台的方式得到CPU /内存利用率的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!