public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Christopher Friesen" <cfriesen@nortelnetworks.com>
To: Manfred Bartz <md-linux-kernel@logi.cc>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Anyone else interested in a high-precision monotonic counter?
Date: Fri, 05 Jan 2001 09:37:34 -0500	[thread overview]
Message-ID: <3A55DC2E.9C342224@nortelnetworks.com> (raw)
In-Reply-To: <Pine.BSF.4.21.0012180711330.89819-100000@beppo.feral.com> <3A3E336C.B29BBA89@nortelnetworks.com> <14912.11470.540247.408234@diego.linuxcare.com.au> <3A550AC8.D22D0CE4@nortelnetworks.com> <20010105032900.22980.qmail@logi.cc>

Manfred Bartz wrote:

> Why a new system call?
Well, you'd be accessing a different kernel variable--"ytime" instead of
"xtime". This new variable wouldn't be adjusted when the  system
time/date was, it would start at zero and always increase. 
 
> regarding a:  it could have microsecond resolution but not
>               microseconds accuracy.

On PPC and x86 systems, gettimeofday() is both accurate and precise to
microseconds, since it is based off of jiffies and then offset to get
microseconds.


> regarding b:  have you looked at the return-value of times(2)
>               Or roll your own using setitimer(2)

Both of these are precise only to jiffies, which defaults at 10
milliseconds on x86 and PPC.  If you want microsecond timing, the only
current standard way to do it is to use gettimeofday(), which is
sensitive to changes in system date and time.




-- 
Chris Friesen                    | MailStop: 043/33/F10  
Nortel Networks                  | work: (613) 765-0557
3500 Carling Avenue              | fax:  (613) 765-2986
Nepean, ON K2H 8E9 Canada        | email: cfriesen@nortelnetworks.com
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

  reply	other threads:[~2001-01-05 14:40 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-12-16 19:07 ServerWorks docs? Rico Tudor
2000-12-16 20:00 ` davej
2000-12-17  2:29   ` Jeff Nguyen
2000-12-18 10:04     ` Rico Tudor
2000-12-18 15:15       ` Matthew Jacob
2000-12-18 15:55         ` gettimeofday() non-monotonic on uniprocessor system with ntp turned off? Christopher Friesen
2000-12-20  3:51           ` Paul Mackerras
2001-01-04 23:44             ` Anyone else interested in a high-precision monotonic counter? Christopher Friesen
2001-01-05  3:29               ` Manfred Bartz
2001-01-05 14:37                 ` Christopher Friesen [this message]
2001-01-12  4:16                   ` Manfred Bartz
2000-12-19  7:10       ` ServerWorks docs? Jeff Nguyen
2000-12-17  3:54   ` Dan Hollis
2000-12-17  0:25 ` J . A . Magallon

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=3A55DC2E.9C342224@nortelnetworks.com \
    --to=cfriesen@nortelnetworks.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=md-linux-kernel@logi.cc \
    /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