Timers and timing, was: MySQL Performance 6.0rc1

Poul-Henning Kamp phk at phk.freebsd.dk
Fri Oct 28 07:16:24 PDT 2005


In message <436226AF.10109 at freebsd.org>, David Xu writes:

>That's just an idea. :-)
>As robert said, add a lower resolution CLOCK_ type  may work well.
>Another thing I just though of, if reading timercounter is so slow, won't
>gettimeofday hardly block cpu too many cycles ? the cpu is just stucked
>there by a slow clock in hardware signals.

The get*() family of functions just copy a timestamp, they go nowhere
near hardware.  So they are fast, but less precise (~ 1 msec).

-- 
Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
phk at FreeBSD.ORG         | TCP/IP since RFC 956
FreeBSD committer       | BSD since 4.3-tahoe    
Never attribute to malice what can adequately be explained by incompetence.


More information about the freebsd-current mailing list