public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Chris Friesen <cfriesen@nortel.com>
To: Peter Chubb <peterc@gelato.unsw.edu.au>
Cc: krishna <krishna.c@globaledgesoft.com>,
	Linux Kernel <linux-kernel@vger.kernel.org>
Subject: Re: How to measure time accurately.
Date: Tue, 29 Mar 2005 18:24:16 -0600	[thread overview]
Message-ID: <4249F1B0.6050800@nortel.com> (raw)
In-Reply-To: <16969.58762.180127.283274@wombat.chubb.wattle.id.au>

Peter Chubb wrote:
>>>>>>"Chris" == Chris Friesen <cfriesen@nortel.com> writes:

> Chris> Most cpus have some way of getting at a counter or decrementer
> Chris> of various frequencies.  Usually it requires low-level hardware
> Chris> knowledge and often it needs assembly code.
> 
> As a device driver is inside the linux kernel (unless you're writein a
> user-mode device driver :-)) you can use the getcycles() macro that's
> defined for most architectures.  It provides a snapshot of the
> cycle-counter.

For ppc this only gives 32-bit values, which overflow every 129 seconds 
on my G5.  Depending on how long you're trying to time, this could be a 
problem.

Chris

  reply	other threads:[~2005-03-30  0:24 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
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 [this message]
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=4249F1B0.6050800@nortel.com \
    --to=cfriesen@nortel.com \
    --cc=krishna.c@globaledgesoft.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peterc@gelato.unsw.edu.au \
    /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