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

后端 未结 9 968
后悔当初
后悔当初 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 06:56

    No, there isn't, not in the standard.

    If you truly need this information, you will have to write platform-specific #ifdefs or link against a library that provides it.

提交回复
热议问题