gettimeofday() in hping

Daniel Eischen deischen at
Tue Jan 22 06:03:35 PST 2008

On Tue, 22 Jan 2008, Dag-Erling Smørgrav wrote:

> Dag-Erling Smørgrav <des at> writes:
>> Stefan Lambrev <stefan.lambrev at> writes:
>>> I tried clock_gettime() (using CLOCK_REALTIME for clock_id), but this
>>> yield worse performance.
>> Try CLOCK_MONOTONIC instead.
> I forgot - there are also the FreeBSD-specific CLOCK_REALTIME_FAST and
> CLOCK_MONOTONIC_FAST if you can live with a little bit of jitter.

Not to discount any of your suggestions, but isn't the better
performance of gettimeofday() (and perhaps clock_gettime() also)
in Linux because they have access to the time in userland and
can implement it without a system call?  I seem to recall this
being mentioned before, I could be wrong...


More information about the freebsd-hackers mailing list