How to get current CPU and RAM usage in C++?

后端 未结 9 981
后悔当初
后悔当初 2020-12-01 06:44

is it possible, in C++, to get the current RAM and CPU usage? Is there a platform-indepentent function call?

9条回答
  •  被撕碎了的回忆
    2020-12-01 07:09

    There is an open source library that gives these (and more system info stuff) across many platforms: SIGAR API

    I've used it in fairly large projects and it works fine (except for certain corner cases on OS X etc.)

提交回复
热议问题