From owner-freebsd-current@FreeBSD.ORG Fri Oct 28 14:16: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 8FD3D16A41F; Fri, 28 Oct 2005 14:16:24 +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 3536143D45; Fri, 28 Oct 2005 14:16:24 +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 4B5D6BC93; Fri, 28 Oct 2005 14:16:22 +0000 (UTC) To: David Xu From: "Poul-Henning Kamp" In-Reply-To: Your message of "Fri, 28 Oct 2005 21:25:03 +0800." <436226AF.10109@freebsd.org> Date: Fri, 28 Oct 2005 16:16:22 +0200 Message-ID: <32650.1130508982@critter.freebsd.dk> Sender: phk@critter.freebsd.dk Cc: Pertti Kosunen , ticso@cicely.de, "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: Fri, 28 Oct 2005 14:16:24 -0000 In message <436226AF.10109@freebsd.org>, David Xu writes: >That's just an idea. :-) >As robert said, add a lower resolution CLOCK_ type may work well. >Another thing I just though of, if reading timercounter is so slow, won't >gettimeofday hardly block cpu too many cycles ? the cpu is just stucked >there by a slow clock in hardware signals. The get*() family of functions just copy a timestamp, they go nowhere near hardware. So they are fast, but less precise (~ 1 msec). -- 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.