跨平台的方式得到CPU /内存利用率

编程入门 行业动态 更新时间:2024-10-25 00:31:57
本文介绍了跨平台的方式得到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 有的getrusage ,应该在大多数,如果不是工作的所有支持的平台。

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

更多推荐

跨平台的方式得到CPU /内存利用率

本文发布于:2023-11-03 20:07:57,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1555972.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:利用率   内存   方式   平台   CPU

发布评论

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

>www.elefans.com

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