Re: Question about gettimeofday

From: Chris Friesen (
Date: Tue Jul 31 2001 - 08:29:19 EST

Subhash S wrote:
> Hi All,
> In my application I use gettimeofday very frequently, as it is system
> call on linux it is expensive, where as on Solaris it is not so. Could
> you please tell me how solaris is implemented the function gettimeofday.

While I can't tell you how Solaris implemented it, I can say that in general if
you want very frequent timing access you're probably better off using inline
assembly to get at some processor-specific timer. On a 400Mhz G4, the
difference was about a microsecond for gettimeofday() vs about 25 nanoseconds
for the assembly code.

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:
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

This archive was generated by hypermail 2b29 : Tue Jul 31 2001 - 21:00:51 EST