convert jiffies to seconds

后端 未结 4 578
悲&欢浪女
悲&欢浪女 2021-01-04 18:28

I\'ve got a piece of userspace code which is parsing /proc/PID/task/TID/stat to get the cpu usage. I can use HZ to get the jiffies per second but this code could move to an

4条回答
  •  滥情空心
    2021-01-04 19:21

    You divide it by the number you get from sysconf(_SC_CLK_TCK).

    However, I think this is probably always 100 under Linux regardless of the actual clock tick, it's always presented to userspace as 100.

    See man proc(5).

提交回复
热议问题