* Does 2.6.26 provide nanosecond time to the user?
@ 2008-07-18 0:19 Reg Clemens
2008-07-18 1:42 ` Måns Rullgård
2008-07-18 3:46 ` Chris Friesen
0 siblings, 2 replies; 6+ messages in thread
From: Reg Clemens @ 2008-07-18 0:19 UTC (permalink / raw)
To: linux-kernel
Im confused.
(sorry I havent been following the linux-kernel mailing list on this)
Does 2.6.26 use nanosecond time
(1) internally?
(2) provide it to the user?
I see no way to turn it on/off in xconfig.
Yet I do see STA_NANO defined in sys/timex.h which is a good start.
and IF it provides it to the user, what do I use to get nanosecond time.
My search with man -k for timespec turns up
sys_clock_getres
and sys_clock_gettime
or possibly clock_getres and clock_gettime, the man pages use both,
but NONE of these entry points seem to exist in my system.
Puzzled.
--
Reg.Clemens
reg@dwf.com
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Does 2.6.26 provide nanosecond time to the user?
2008-07-18 0:19 Reg Clemens
@ 2008-07-18 1:42 ` Måns Rullgård
2008-07-18 2:19 ` Reg Clemens
2008-07-18 3:46 ` Chris Friesen
1 sibling, 1 reply; 6+ messages in thread
From: Måns Rullgård @ 2008-07-18 1:42 UTC (permalink / raw)
To: linux-kernel
Reg Clemens <reg@dwf.com> writes:
> Im confused.
> (sorry I havent been following the linux-kernel mailing list on this)
>
> Does 2.6.26 use nanosecond time
> (1) internally?
> (2) provide it to the user?
>
> I see no way to turn it on/off in xconfig.
> Yet I do see STA_NANO defined in sys/timex.h which is a good start.
>
> and IF it provides it to the user, what do I use to get nanosecond time.
> My search with man -k for timespec turns up
> sys_clock_getres
> and sys_clock_gettime
>
> or possibly clock_getres and clock_gettime, the man pages use both,
> but NONE of these entry points seem to exist in my system.
You might need to link with -lrt to get those functions.
--
Måns Rullgård
mans@mansr.com
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Does 2.6.26 provide nanosecond time to the user?
[not found] <fa.cG/vRVVC+ZH1htzxsRnVF3NJVCc@ifi.uio.no>
@ 2008-07-18 1:48 ` Robert Hancock
0 siblings, 0 replies; 6+ messages in thread
From: Robert Hancock @ 2008-07-18 1:48 UTC (permalink / raw)
To: Reg Clemens; +Cc: linux-kernel
Reg Clemens wrote:
> Im confused.
> (sorry I havent been following the linux-kernel mailing list on this)
>
> Does 2.6.26 use nanosecond time
> (1) internally?
> (2) provide it to the user?
>
> I see no way to turn it on/off in xconfig.
> Yet I do see STA_NANO defined in sys/timex.h which is a good start.
>
> and IF it provides it to the user, what do I use to get nanosecond time.
> My search with man -k for timespec turns up
> sys_clock_getres
> and sys_clock_gettime
>
> or possibly clock_getres and clock_gettime, the man pages use both,
> but NONE of these entry points seem to exist in my system.
>
> Puzzled.
clock_gettime should exist. Old glibc version?
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Does 2.6.26 provide nanosecond time to the user?
2008-07-18 1:42 ` Måns Rullgård
@ 2008-07-18 2:19 ` Reg Clemens
2008-08-01 14:11 ` Christoph Lameter
0 siblings, 1 reply; 6+ messages in thread
From: Reg Clemens @ 2008-07-18 2:19 UTC (permalink / raw)
To: Måns Rullgård; +Cc: linux-kernel, reg
> Reg Clemens <reg@dwf.com> writes:
>
> > Im confused.
> > (sorry I havent been following the linux-kernel mailing list on this)
> >
> > Does 2.6.26 use nanosecond time
> > (1) internally?
> > (2) provide it to the user?
> >
> > I see no way to turn it on/off in xconfig.
> > Yet I do see STA_NANO defined in sys/timex.h which is a good start.
> >
> > and IF it provides it to the user, what do I use to get nanosecond time.
> > My search with man -k for timespec turns up
> > sys_clock_getres
> > and sys_clock_gettime
> >
> > or possibly clock_getres and clock_gettime, the man pages use both,
> > but NONE of these entry points seem to exist in my system.
>
> You might need to link with -lrt to get those functions.
>
Thanks, -lrt works fine, that answers that part of the question, how about
the first question.
--
Reg.Clemens
reg@dwf.com
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Does 2.6.26 provide nanosecond time to the user?
2008-07-18 0:19 Reg Clemens
2008-07-18 1:42 ` Måns Rullgård
@ 2008-07-18 3:46 ` Chris Friesen
1 sibling, 0 replies; 6+ messages in thread
From: Chris Friesen @ 2008-07-18 3:46 UTC (permalink / raw)
To: Reg Clemens; +Cc: linux-kernel
Reg Clemens wrote:
> Im confused.
> (sorry I havent been following the linux-kernel mailing list on this)
>
> Does 2.6.26 use nanosecond time
> (1) internally?
> (2) provide it to the user?
It's available to userspace via clock_gettime(), but whether it really
is accurate to sub-microseconds will depend on the specific version of
the kernel and hardware architecture being used.
Chris
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Does 2.6.26 provide nanosecond time to the user?
2008-07-18 2:19 ` Reg Clemens
@ 2008-08-01 14:11 ` Christoph Lameter
0 siblings, 0 replies; 6+ messages in thread
From: Christoph Lameter @ 2008-08-01 14:11 UTC (permalink / raw)
To: Reg Clemens; +Cc: Måns Rullgård, linux-kernel, reg
Reg Clemens wrote:
> Thanks, -lrt works fine, that answers that part of the question, how about
> the first question.
The kernels use a variety of clocks internally. If the clocks are capable of
nanosecond resolution then the results will be available via clock_gettime().
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2008-08-01 14:12 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <fa.cG/vRVVC+ZH1htzxsRnVF3NJVCc@ifi.uio.no>
2008-07-18 1:48 ` Does 2.6.26 provide nanosecond time to the user? Robert Hancock
2008-07-18 0:19 Reg Clemens
2008-07-18 1:42 ` Måns Rullgård
2008-07-18 2:19 ` Reg Clemens
2008-08-01 14:11 ` Christoph Lameter
2008-07-18 3:46 ` Chris Friesen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox