public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: abhijit <slashdev@gmail.com>
To: Lukasz Michal Rak <l.rak@elka.pw.edu.pl>
Cc: linux-kernel@vger.kernel.org
Subject: Re: do_gettimeofday( ) precision?
Date: Thu, 24 Jun 2004 12:13:11 +0530	[thread overview]
Message-ID: <7c07cd6904062323437ff6ac69@mail.gmail.com> (raw)
In-Reply-To: <Pine.GSO.4.58.0406231747300.2009@mion.elka.pw.edu.pl>

On Wed, 23 Jun 2004 17:54:13 +0200 (CEST), Lukasz Michal Rak
<l.rak@elka.pw.edu.pl> wrote:

> I don't know the way how to do it, but I wonder about 
> precision of such mechanism (if any exists).

basically i want some counter w/ microsend resolution that fits into 32 bits.
couple of possible solutions come to my mind:

[1]  use TSC and convert it to microsec
[2] use get_timeofday( ) and convert to microsec
[3] use xtime variable directly and convert to microsec
(any other ways?)

conversion in [1] will be costly (a div involved). 
conversion in [2]/[3] can be done using bit operators. (usec|sec << 20)
but [2] will incur function call overhead which i'd like to avoid.

so is using xtime directly ok and reliable?

thanks
abhijit

  reply	other threads:[~2004-06-24  6:43 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-06-23 15:23 do_gettimeofday( ) precision? abhijit
2004-06-23 15:54 ` Lukasz Michal Rak
2004-06-24  6:43   ` abhijit [this message]
2004-06-24  6:59     ` abhijit

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=7c07cd6904062323437ff6ac69@mail.gmail.com \
    --to=slashdev@gmail.com \
    --cc=l.rak@elka.pw.edu.pl \
    --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