Measuring CPU time with getrusage
Hi,
I'm trying to measure the CPU time of several algorithms (some written in C others in Python) by using getrusage() after wait() for the child process to end.
On a machine with hypterthreading, the measured user times depend a lot on the system load of the machine. A heavy system load sometimes increases the measured time by 10x!
Is there a better way to measure the used CPU time of a given process (or part of a program) or have I missed some important fact?
Any help appreciated.
Thanks,
Marco