linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Measuring CPU time with getrusage
@ 2010-01-16 13:34 Marco Almeida
  0 siblings, 0 replies; only message in thread
From: Marco Almeida @ 2010-01-16 13:34 UTC (permalink / raw)
  To: linux-kernel


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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2010-01-16 14:04 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-01-16 13:34 Measuring CPU time with getrusage Marco Almeida

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).