From owner-freebsd-hackers Fri Nov 3 10:31: 6 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from cs.waikato.ac.nz (taupo.cs.waikato.ac.nz [130.217.241.30]) by hub.freebsd.org (Postfix) with ESMTP id 2FDFE37B4C5 for ; Fri, 3 Nov 2000 10:31:02 -0800 (PST) Received: (from joerg@localhost) by cs.waikato.ac.nz (8.9.3/8.9.3) id HAA29740; Sat, 4 Nov 2000 07:27:39 +1300 (NZDT) (envelope-from joerg) Date: Sat, 4 Nov 2000 07:27:39 +1300 From: Joerg Micheel To: Poul-Henning Kamp Cc: Zhiui Zhang , freebsd-hackers@freebsd.org, joerg@cs.waikato.ac.nz Subject: Re: granularity of gettimeofday() Message-ID: <20001104072739.K26626@cs.waikato.ac.nz> References: <1581.973275681@critter> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1581.973275681@critter>; from phk@critter.freebsd.dk on Fri, Nov 03, 2000 at 07:21:21PM +0100 Organization: Dept of Computer Science, University of Waikato, Hamilton, New Zealand Project: WAND - Waikato Applied Network Dynamics, DAG Operating-System: ... powered by FreeBSD Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Fri, Nov 03, 2000 at 07:21:21PM +0100, Poul-Henning Kamp wrote: > The long answer is: FreeBSD can deliver time with a resolution of > 1/2^32 nanosecond = 232.8E-21 seconds. The actual resolution is > much worse, because the hardware usually doesn't provide any better > than about a nanosecond at best these days. On certain hardware > only about a microsecond of actual resolution is available. Why could't gettimeofday be tuned to provide nanosecond resolution in reality, with the assistance of the TSC register ? I understand this does not work on a 486, but that's not the platform people ask for such a resolution. With every celeron today exceeding 300 MHz, 3 nanoseconds is a reality. Of course, there will be syscall overhead, understood. Joerg -- Joerg B. Micheel Email: WAND and NLANR MOAT Email: The University of Waikato, CompScience Phone: +64 7 8384794 Private Bag 3105 Fax: +64 7 8585095 Hamilton, New Zealand Plan: PMA, TINE and the DAG's To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message