From owner-freebsd-hackers Sat Apr 13 7:20:53 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from critter.freebsd.dk (critter.freebsd.dk [212.242.86.163]) by hub.freebsd.org (Postfix) with ESMTP id E7DB237B41A for ; Sat, 13 Apr 2002 07:20:48 -0700 (PDT) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.12.2/8.12.2) with ESMTP id g3DEKfYu019994; Sat, 13 Apr 2002 16:20:45 +0200 (CEST) (envelope-from phk@critter.freebsd.dk) To: John Hay Cc: hackers@freebsd.org Subject: Re: microtime trustworthiness during booting? In-Reply-To: Your message of "Sat, 13 Apr 2002 15:50:10 +0200." <200204131350.g3DDoBn69302@zibbi.icomtek.csir.co.za> Date: Sat, 13 Apr 2002 16:20:41 +0200 Message-ID: <19993.1018707641@critter.freebsd.dk> From: Poul-Henning Kamp Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG In message <200204131350.g3DDoBn69302@zibbi.icomtek.csir.co.za>, John Hay write s: >Hi, > >>From what stage during the boot process can I trust that microtime() will >give me incrementing time? > >The reason I ask is that I see microtime() jump backwards consistently >during the ich_calibrate() function in the ich sound driver. The values >look basically the same every time. Something like this: > >t1 2 sec 389291 usec >t2 0 sec 32061 usec Until interrupts work you cannot rely on timecounters. You should probably use microuptime() not microtime() any case. >Can it be that there is some kind of glitch somewhere when the TSC >take over as timecounter? Unlikely. -- 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. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message