From owner-freebsd-current@FreeBSD.ORG Sat Oct 29 21:05:54 2005 Return-Path: X-Original-To: current@FreeBSD.org Delivered-To: freebsd-current@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4EDAB16A41F; Sat, 29 Oct 2005 21:05:54 +0000 (GMT) (envelope-from jmg@hydrogen.funkthat.com) Received: from hydrogen.funkthat.com (gate.funkthat.com [69.17.45.168]) by mx1.FreeBSD.org (Postfix) with ESMTP id BCBD243D45; Sat, 29 Oct 2005 21:05:53 +0000 (GMT) (envelope-from jmg@hydrogen.funkthat.com) Received: from hydrogen.funkthat.com (localhost.funkthat.com [127.0.0.1]) by hydrogen.funkthat.com (8.13.3/8.13.3) with ESMTP id j9TL5r0J094505; Sat, 29 Oct 2005 14:05:53 -0700 (PDT) (envelope-from jmg@hydrogen.funkthat.com) Received: (from jmg@localhost) by hydrogen.funkthat.com (8.13.3/8.13.3/Submit) id j9TL5ojG094504; Sat, 29 Oct 2005 14:05:50 -0700 (PDT) (envelope-from jmg) Date: Sat, 29 Oct 2005 14:05:50 -0700 From: John-Mark Gurney To: Poul-Henning Kamp Message-ID: <20051029210550.GV4115@funkthat.com> Mail-Followup-To: Poul-Henning Kamp , Robert Watson , Pertti Kosunen , David Xu , "Yuriy N. Shkandybin" , current@freebsd.org References: <20051029005719.I20147@fledge.watson.org> <37685.1130571501@critter.freebsd.dk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <37685.1130571501@critter.freebsd.dk> User-Agent: Mutt/1.4.2.1i X-Operating-System: FreeBSD 5.4-RELEASE-p6 i386 X-PGP-Fingerprint: B7 EC EF F8 AE ED A7 31 96 7A 22 B3 D8 56 36 F4 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html Cc: Pertti Kosunen , Robert Watson , David Xu , "Yuriy N. Shkandybin" , current@FreeBSD.org Subject: Re: Timers and timing, was: MySQL Performance 6.0rc1 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: John-Mark Gurney List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Oct 2005 21:05:54 -0000 Poul-Henning Kamp wrote this message on Sat, Oct 29, 2005 at 09:38 +0200: > In message <20051029005719.I20147@fledge.watson.org>, Robert Watson writes: > > >It strikes me that replacing time(3) with something that retrieves > >CLOCK_SECOND shouldn't harm time(3) semantics. > > It will mean that time(3) is can do minor (~1/hz) timetravel relative > to the other calls: > > clock_gettime() time(3) > > 123.999999123 > 123 > 124.000000234 > 123 > (hardclock happens) > 124.001020934 > 124 > > If we can live with this, there is no problem. This also gets into the question how do you round a second? :) I think this is fine, or make the leap to 124 on the hardclock before we hit 124... either way, the error introduced is much less than the acuracy returned by times, and should be safely ignored... (and the delay in change is balanced out by the previous delay)... If you cared that much that you were .001 seconds after 124, you'd be using a more acurate clock... -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not."