相关疑难解决方法(0)

linux上进程的开始时间

如何使用c语言在ubuntu linux机器上查找进程启动时间。在 linux 中有提供信息的 /proc/[pid]/stat 文件

starttime %lu /*The time in jiffies the process started after system boot*/
和文件 /proc/stat 给出

btime %lu /*measurement of system boot time since Epoch in seconds*/  
Run Code Online (Sandbox Code Playgroud)

为了添加这两个值,我如何将前一个值转换为秒,因为它以 jiffies 为单位。

c linux process

4
推荐指数
1
解决办法
8052
查看次数

标签 统计

c ×1

linux ×1

process ×1