Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 16 May 2001 17:55:49 +1000 (EST)
From:      Bruce Evans <bde@zeta.org.au>
To:        Poul-Henning Kamp <phk@critter.freebsd.dk>
Cc:        Dave Leimbach <dleimbac@MPI-Softtech.Com>, tlambert2@mindspring.com, eischen@vigrid.com, dillon@earth.backplane.com, dleimbac@earthlink.net, freebsd-questions@FreeBSD.ORG, arch@FreeBSD.ORG
Subject:   Re: Gettimeofday Again... 
Message-ID:  <Pine.BSF.4.21.0105161751150.8121-100000@besplex.bde.org>
In-Reply-To: <33655.989935845@critter>

next in thread | previous in thread | raw e-mail | index | archive | help
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-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.21.0105161751150.8121-100000>