Re: Timers and timing, was: MySQL Performance 6.0rc1

From: Poul-Henning Kamp <phk_at_phk.freebsd.dk>
Date: Fri, 28 Oct 2005 16:16:22 +0200
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.
Received on Fri Oct 28 2005 - 12:16:24 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:46 UTC