lkml.org 
[lkml]   [2001]   [Jan]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Anyone else interested in a high-precision monotonic counter?
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/

\
 
 \ /
  Last update: 2005-03-22 12:52    [W:0.041 / U:0.140 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site