Artificial intelligent assistant

Measure units in /proc/<pid>/schedstat I need to get statistics from **/proc/pid/schedstat** for a particular process. Here < I found the description of fields. What are measure units of (1) time spent on the cpu and of (2) time spent waiting on a runqueue? How convert them to seconds? Are they measured in clock ticks and I should divide them by **sysconf(_SC_CLK_TCK)**?

The documentation says they are in "jiffies", but the documentation is outdated. Try running a CPU-intensive task and sampling the counters a few seconds apart, and you'll see they increment too quickly to feasibly be in jiffies.

The documentation became wrong with the adoption of the Completely Fair Scheduler (CFS) which is the default on modern kernels, so divide by 1000000000 to convert to seconds.

<

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy 209cd8ff751f29797ddab6823bc86203