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
To clarify the math behind MarkR's answer:
sysconf(_SC_CLK_TCK) will get you jiffies per second. Divide jiffies by the number you get from sysconf(_SC_CLK_TCK) to get the total number of seconds.
jiffies jiffies seconds
-------------------- = ----------------- = ------- = seconds
sysconf(_SC_CLK_TCK) (jiffies/second) 1