On Sat, Aug 14 2021, Baptiste Jonglez <bapti...@bitsofnetworks.org> wrote: > Hello,
Hi Baptiste, long time no see. :) > I would like to determine the CPU usage of a process on a "real-time" > basis. That is, every few seconds (sampling period), I would like to > compute its average CPU usage in the previous period. Looks like a job for getrusage(2) or the CLOCK_PROCESS_CPUTIME_ID clock supported by clock_gettime(2). [...] -- jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF DDCC 0DFA 74AE 1524 E7EE