Re: gettimeofday() system call timing curiosity

From: johan.adolfsson@axis.com
Date: Fri Mar 08 2002 - 15:29:59 EST


>
> > What happens if you remove the printf/puts and simply counts the number
> > of times the different cases happen?
> >
>
> Try it. It doesn't matter. Alan was correct, my computer sucks. However,
> they won't give me a 10 GHz one (yet). Note that although gettimeofday()
> has 1 microsecond resolution, not all the codes are exercised. We get
> something with the granularity of 50 to 190 microseconds.

I admit that I don't know the details of the x86 implementation,
but that sounds a little to large doesn't it?

I recently fixed the cris port to get 1 us resolution (by reading a
25MHz timer value within a jiffie).
My tests show that the time between calls to gettimeofday() typically
is 4-5 us on the 100MIPS ETRAX100LX - not that bad.
On my Linux PC i got 1us most of the time but never the same value,
but that is an old machine - PII 266 (reminds me I need to change machine:).

..
>
> Cheers,
> Dick Johnson

/Johan

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Fri Mar 15 2002 - 22:00:09 EST