I am looking to measure total clock cycles used by a program. I am hoping to measure this from another process.
clock_tcan be used to measure a block of code but doesn't work for me because I want to measure total clock cycles of another program/proc/PID/statcan tell you the total user time and kernel time a process has used but I am hoping to capture this information when the process completes
Any other ideas for how to reliably capture this?
Yes, albeit I am not sure how reliable it is. c has some built in libraries you can use for this. I chose to do it in Rust but you can probably look up the parts you need. TLDR spawning a child process and rusage