Call getrusage() to return a struct containing some information.
getrusage(2): resource usage - Linux man page
Rummage through the /proc/PID/stat file to find yet more information.
proc(5): process info pseudo-file system - Linux man page
Call getrusage() to return a struct containing some information.
getrusage(2): resource usage - Linux man page
Rummage through the /proc/PID/stat file to find yet more information.
proc(5): process info pseudo-file system - Linux man page
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.