All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Friesen <cfriesen@nortel.com>
To: krishna <krishna.c@globaledgesoft.com>
Cc: Linux Kernel <linux-kernel@vger.kernel.org>
Subject: Re: How to measure time accurately.
Date: Mon, 28 Mar 2005 23:07:14 -0600	[thread overview]
Message-ID: <4248E282.1000105@nortel.com> (raw)
In-Reply-To: <424779F3.5000306@globaledgesoft.com>

krishna wrote:
> Hi All,
> 
> Can any one tell me how to measure time accurately for a block of C code 
> in device drivers.
> For example, If I want to measure the time duration of firmware download.

Most cpus have some way of getting at a counter or decrementer of 
various frequencies.  Usually it requires low-level hardware knowledge 
and often it needs assembly code.


On ppc you'd use the mftbu/mftbl instructions, as suggested by Lee on 
x86 you'd use the rdtsc instruction.

Chris

  parent reply	other threads:[~2005-03-29  5:07 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-03-28  3:28 How to measure time accurately krishna
2005-03-29  3:37 ` Lee Revell
2005-03-29  5:07 ` Chris Friesen [this message]
2005-03-29  9:10   ` Jesper Juhl
2005-03-29  9:25     ` Jan Engelhardt
2005-03-29 23:32   ` Peter Chubb
2005-03-30  0:24     ` Chris Friesen
2005-03-30  9:46       ` Jan Engelhardt

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=4248E282.1000105@nortel.com \
    --to=cfriesen@nortel.com \
    --cc=krishna.c@globaledgesoft.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.