On Fri, 19 Aug 2005, Amos Shapira wrote:

> On 8/19/05, guy keren <[EMAIL PROTECTED]> wrote:
> > actually, it _looks_ like gettimeofday() sometimes takes less then a
> > micro-second to execute. i tested it a few years ago on redhat 7.3, on a
> > pentium 1.8MHz and an AMD athlon 2200+, and on both ofthem running
> > gettimeofday in a tight loop very often yielded the same time (and
> > gettimeofday returns the time in microsecond resolution).
>
> I'm not sure this is a correct way to measure - gettimeofday(2)'s *interface
> definition* is to count nanoseconds, but that doesn't mean that the system's
> clock can measure at this resolution.

on redhat 7.3 (that's where i made the tests, as i wrote), gettimeofday
returns the time in a 'struct timeval', which has the time in seconds and
micro-seconds. for the gory details - arch/XXX/kernel/time.c -
do_gettimeofday().

the fact is, that i kept getting very close values - closer then the
'clock ticks' you get when using nanosleep in normal priority (i.e. the
sleeps on the arch mentioned previously are 10ms or higher).

you want to argue - argue with the numbers, not with me. ;) i'm not taking
sides.

--
guy

"For world domination - press 1,
 or dial 0, and please hold, for the creator." -- nob o. dy

=================================================================
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]

Reply via email to