* is the resolution of do_gettimeofday in usec?
@ 2009-05-31 22:51 wael showair
2009-06-02 20:28 ` Chris Friesen
0 siblings, 1 reply; 2+ messages in thread
From: wael showair @ 2009-05-31 22:51 UTC (permalink / raw)
To: linuxppc-dev
Hi All,
i have board that contains MPC8555 processor with linux 2.6.27 ported to it.
i want to use an accurate function to measure the time. i searched the
kernel code & i found several functions but i read that the do_gettimeofday
is the most accurate one since it has a timer resolution of usec.
my question is how this function give this accuracy while the kernel timer
is 4msec?
is this a real accuracy or does it convert from msec to usec?
or does it depend on another timer counter that has this resolution?
or may b it measure the clock cycles of the processor within certain
interval?
Note that the freq of the processor is 850MHz.
Unfortunately, the function is implemented in assembly & i cant understand
it?
so can u tell me how this accurate numbers can be got or they r just fake
numbers?
thanks
--
View this message in context: http://www.nabble.com/is-the-resolution-of-do_gettimeofday-in-usec--tp23807779p23807779.html
Sent from the linuxppc-dev mailing list archive at Nabble.com.
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: is the resolution of do_gettimeofday in usec?
2009-05-31 22:51 is the resolution of do_gettimeofday in usec? wael showair
@ 2009-06-02 20:28 ` Chris Friesen
0 siblings, 0 replies; 2+ messages in thread
From: Chris Friesen @ 2009-06-02 20:28 UTC (permalink / raw)
To: wael showair; +Cc: linuxppc-dev
wael showair wrote:
> Hi All,
> i have board that contains MPC8555 processor with linux 2.6.27 ported to it.
> i want to use an accurate function to measure the time. i searched the
> kernel code & i found several functions but i read that the do_gettimeofday
> is the most accurate one since it has a timer resolution of usec.
You might also look at clock_gettime(), which has a theoretical accuracy
of nanoseconds. Both this and gettimeofday are NTP-corrected if you are
synced to an NTP clock.
> my question is how this function give this accuracy while the kernel timer
> is 4msec?
The accuracy of the timestamp is not related to the tick interval.
Chris
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-06-02 20:28 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-31 22:51 is the resolution of do_gettimeofday in usec? wael showair
2009-06-02 20:28 ` Chris Friesen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).