Subject: Re: timing issue
To: None <firstname.lastname@example.org>
From: Michael van Elst <email@example.com>
Date: 11/19/2006 08:10:06
firstname.lastname@example.org ("Jonathan A. Kollasch") writes:
>Because FreeBSD 6.1 has timecounters. NetBSD 3.1 does not. You really want
>to test this on netbsd-4 or -current, as timecounters were added since
>the 3.x branches.
kern.timecounter.choice = clockinterrupt(q=0, f=100 Hz) TSC(q=-100, f=1666762200
Hz) ACPI-Safe(q=900, f=3579545 Hz) i8254(q=100, f=1193182 Hz) dummy(q=-1000000,
kern.timecounter.hardware = ACPI-Safe
gettimeofday: 5 usec
nanosleep: 14604 usec
usleep: 19897 usec
select: 19905 usec
Looks like it is more related to HZ than to time counters. Minimum
resolution seems to be 2 ticks. The first measurement (nanosleep)
is shorter because it starts somewhere within a clock cycle, the
next measurements are synchronized to it.
Michael van Elst
"A potential Snark may lurk in every tree."