From: "Manfred Bartz" <md-linux-kernel@logi.cc>
To: linux-kernel@vger.kernel.org
Subject: Re: Anyone else interested in a high-precision monotonic counter?
Date: 05 Jan 2001 14:29:00 +1100 [thread overview]
Message-ID: <20010105032900.22980.qmail@logi.cc> (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>
In-Reply-To: "Christopher Friesen"'s message of "Thu, 04 Jan 2001 18:44:08 -0500"
"Christopher Friesen" <cfriesen@nortelnetworks.com> writes:
> Has anyone ever considered including a microsecond-precision
> monotonically-increasing counter in the kernel? This would allow for
> easy timing of alarms and such by using absolute values of when the
> alarm should expire rather than a list of deltas from previous alarms.
>
> The thing I have in mind would store a value something like "xtime"
> (maybe call it "ytime"?) in the kernel. This value would be initialized
> to zero on startup, and would be incremented at the same time as
> "xtime". However, while "xtime" reflects adjustments to the actual
> system time (settimeofday(), date, ntp, etc.), this value would not.
> Finally, it would be accessed with a system call essentially identical
> to sys_gettimeofday(), only it would access "ytime" instead of "xtime"
> before going down and getting the microseconds from the RTC.
>
> This doesn't seem to me as though it would be all that tricky to add,
> and I could see it being very useful in providing a timing source that
> is guaranteed to
> a) be accurate to microseconds and
> b) never go backwards.
Why a new system call?
regarding a: it could have microsecond resolution but not
microseconds accuracy.
regarding b: have you looked at the return-value of times(2)
Or roll your own using setitimer(2)
--
Manfred
-
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/
next prev parent reply other threads:[~2001-01-05 3:32 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 [this message]
2001-01-05 14:37 ` Christopher Friesen
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=20010105032900.22980.qmail@logi.cc \
--to=md-linux-kernel@logi.cc \
--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