From owner-freebsd-arch Wed May 16 0:57:33 2001 Delivered-To: freebsd-arch@freebsd.org Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by hub.freebsd.org (Postfix) with ESMTP id 0220B37B423; Wed, 16 May 2001 00:57:29 -0700 (PDT) (envelope-from bde@zeta.org.au) Received: from bde.zeta.org.au (bde.zeta.org.au [203.2.228.102]) by mailman.zeta.org.au (8.9.3/8.8.7) with ESMTP id RAA23073; Wed, 16 May 2001 17:57:07 +1000 Date: Wed, 16 May 2001 17:55:49 +1000 (EST) From: Bruce Evans X-Sender: bde@besplex.bde.org To: Poul-Henning Kamp Cc: Dave Leimbach , tlambert2@mindspring.com, eischen@vigrid.com, dillon@earth.backplane.com, dleimbac@earthlink.net, freebsd-questions@FreeBSD.ORG, arch@FreeBSD.ORG Subject: Re: Gettimeofday Again... In-Reply-To: <33655.989935845@critter> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Tue, 15 May 2001, Poul-Henning Kamp wrote: > In message <200105151353.IAA27481@MPI-Softtech.Com>, Dave Leimbach writes: > >Thanks for all of the great answers... > > > >For now if I want to see better performance of the timing code I can just > >"sysctl -w kern.timecounter.hardware=TSC"?? > > You can try it, but depending on a lot of stuff it may not A) work nor > B) be a good idea if it does. > > If you want a faster (but less exact!) gettimeofday, change the > call to microtime() to getmicrotime() in the gettimeofday() in > kern_time.c This would be insignificantly faster unless the hardware counter read by microtime() is slow (e.g., if it is an i8254), since most of the overhead for gettimeofday() is for the syscall and not to actually determine the time (unless the hardware counter is slow). Even in the kernel, getmicrotime() is only a significant optimization for the case where the hardware counter is slow. Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message