Timer library
Alex Kiernan
alexk at demon.net
Tue Feb 6 09:59:47 UTC 2001
Russ Allbery <rra at stanford.edu> writes:
> Alex Kiernan <alexk at demon.net> writes:
>
> > OK, but there's profilers for every platform (but the Sun one does have
> > the advantage of not needing a rebuild) - I wasn't so much thinking that
> > the code shouldn't be there, but more that it should be a build
> > option. I guess so long as the added cost when disabled is negligible
> > its not an issue.
>
> It's negligible when it's enabled, so far as I can tell.
Yeah, I realised my confusion afterwards as I was thinking of the
enabled case.
> It adds a
> periodic call to gettimeofday, but that's called so frequently by most
> programs that it tends to be pretty efficient (it's implemented as a
> special trap on SPARC, for example, that doesn't go through the normal
> system call channels).
>
Darn, I knew about gethrtime, but not gettimeofday...
fx: man examines libc...
...OK gettimeoday is a wrapper around gethrtime which then converts
the result from ns into a struct timeval. You live & learn!
--
Alex Kiernan, Principal Engineer, Development, Thus PLC
More information about the inn-workers
mailing list