From owner-freebsd-current@FreeBSD.ORG Sat Oct 29 07:38:24 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 F336216A41F; Sat, 29 Oct 2005 07:38:23 +0000 (GMT) (envelope-from phk@critter.freebsd.dk) Received: from phk.freebsd.dk (phk.freebsd.dk [130.225.244.222]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9379C43D45; Sat, 29 Oct 2005 07:38:23 +0000 (GMT) (envelope-from phk@critter.freebsd.dk) Received: from critter.freebsd.dk (unknown [192.168.48.2]) by phk.freebsd.dk (Postfix) with ESMTP id 002F9BC84; Sat, 29 Oct 2005 07:38:21 +0000 (UTC) To: Robert Watson From: "Poul-Henning Kamp" In-Reply-To: Your message of "Sat, 29 Oct 2005 01:01:59 BST." <20051029005719.I20147@fledge.watson.org> Date: Sat, 29 Oct 2005 09:38:21 +0200 Message-ID: <37685.1130571501@critter.freebsd.dk> Sender: phk@critter.freebsd.dk Cc: Pertti Kosunen , 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 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 07:38:24 -0000 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 124.000020300 123 124.000983092 123 (hardclock happens) 124.001020934 124 If we can live with this, there is no problem. >Likewise, keeping >CLOCK_REALTIME as is is likely OK -- if an application requests it using >clock_gettime(), then it is presumably looking for high accuracy. Yes, I think clock_gettime(CLOCK_REALTIME) should remain unchanged. >It's >gettimeofday() that's the troubling one -- it's widely used to query the >time in applications, and its API suggests microsecond resolution. And we don't really have a cheap way to do that... -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence.