From owner-freebsd-hackers Fri Nov 3 10:20:17 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from fw.wintelcom.net (ns1.wintelcom.net [209.1.153.20]) by hub.freebsd.org (Postfix) with ESMTP id 809D437B4D7 for ; Fri, 3 Nov 2000 10:20:12 -0800 (PST) Received: (from bright@localhost) by fw.wintelcom.net (8.10.0/8.10.0) id eA3IHPR27624; Fri, 3 Nov 2000 10:17:25 -0800 (PST) Date: Fri, 3 Nov 2000 10:17:25 -0800 From: Alfred Perlstein To: Zhiui Zhang Cc: Poul-Henning Kamp , freebsd-hackers@FreeBSD.ORG Subject: Re: granularity of gettimeofday() Message-ID: <20001103101725.K20567@fw.wintelcom.net> References: <920.973271386@critter> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.4i In-Reply-To: ; from zzhang@cs.binghamton.edu on Fri, Nov 03, 2000 at 01:01:17PM -0500 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG * Zhiui Zhang [001103 10:08] wrote: > > > On Fri, 3 Nov 2000, Poul-Henning Kamp wrote: > > > In message , Zhiui Zhang writes: > > > > > >The manual says the granularity of gettimeofday() is hardware dependent. > > >The time may be updated continuously or in clock ticks. Can anyone > > >explain for me the two different ways of updating the time? What kind of > > >hardware can help? > > > > You probably need to tell me what you need first... > > This is actually a question from the book "Kernel Project for Linux" and I > am a TA for an operating system course that uses this textbook. I know a > little bit of NTP and Intel Time stamp counter. I need an authoritive > answer for this question because I do not have the time to go through the > FreeBSD code to find out myself in a short time. My impression is that if > the time is updated by an interrupt handler per tick, it can not get a > microsecond granularity. Gettimeofday will force a check of the system hardware, basically you should get better than 100HZ resolution with gettimeofday. -- -Alfred Perlstein - [bright@wintelcom.net|alfred@freebsd.org] "I have the heart of a child; I keep it in a jar on my desk." To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message