From: Marco Almeida <malmeida@netc.pt>
To: linux-kernel@vger.kernel.org
Subject: Measuring CPU time with getrusage
Date: Sat, 16 Jan 2010 13:34:15 +0000 [thread overview]
Message-ID: <x6pr5a18dk.wl%malmeida@netc.pt> (raw)
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
reply other threads:[~2010-01-16 14:04 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=x6pr5a18dk.wl%malmeida@netc.pt \
--to=malmeida@netc.pt \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox