如何使用 C 在 linux 下检索正常运行时间? (不使用 popen 和/或/proc)
谢谢
最佳答案
通过 top
或通过 uptime
,但我不知道任何系统调用,肯定有人知道:)
正常运行时间
应该很容易解析。
刚刚偶然发现了这个:
#include <sys/sysinfo.h>
struct sysinfo info;
sysinfo(&info);
printf("Uptime = %ld\n", info.uptime);
关于c - linux下的C语言正常运行时间,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3070278/