#include <sys/time.h> #include <sys/resource.h> int getrusage(int who, struct rusage *rusage);
This function returns information about the running process. Currently, the only field that is computed is this:
struct rusage { struct timeval ru_utime; /* total time used by process */ };
The remainder of the fields are set to zero.
The who parameter must be RUSAGE_SELF
or
RUSAGE_CHILDREN
.
Zero on success, nonzero on failure.
not ANSI, not POSIX
struct rusage r; getrusage(RUSAGE_SELF, &r);
Go to the first, previous, next, last section, table of contents.