LKML Archive on
help / color / mirror / Atom feed
From: Johann Schuster <>
Subject: Measuring cpu time using getrusage
Date: Wed, 14 Feb 2007 14:17:19 +0100	[thread overview]
Message-ID: <> (raw)


currently i'm trying to measure the cpu times for
numerical algorithms written in C using two calls of
getrusage() and then calculating the time difference.

According to the man page of getrusage i looked at the
user time of my process. Surprisingly the measured user
times vary strongly depending on the system load of the
A heavy system load nearly doubles the measured time
for my routine.

Does anyone know a better way to measure the used
cpu cycles of a given process (or part of a program)
or can anyone give me a hint if i missed some important

Any help appreciated. Thank you in advance.

Johann Schuster

             reply	other threads:[~2007-02-14 15:26 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-14 13:17 Johann Schuster [this message]
2007-02-17 12:09 ` Tim Schmielau

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:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \
    --subject='Re: Measuring cpu time using getrusage' \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

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).