From owner-freebsd-hackers Wed Jul 17 13:25:55 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A6C7137B400 for ; Wed, 17 Jul 2002 13:25:53 -0700 (PDT) Received: from spork.pantherdragon.org (spork.pantherdragon.org [206.29.168.146]) by mx1.FreeBSD.org (Postfix) with ESMTP id F120743E31 for ; Wed, 17 Jul 2002 13:25:52 -0700 (PDT) (envelope-from dmp@pantherdragon.org) Received: from sparx.pantherdragon.org (evrtwa1-ar10-4-61-236-062.evrtwa1.dsl-verizon.net [4.61.236.62]) by spork.pantherdragon.org (Postfix) with ESMTP id 2BD84471D7; Wed, 17 Jul 2002 13:25:52 -0700 (PDT) Received: from pantherdragon.org (speck.techno.pagans [172.21.42.2]) by sparx.pantherdragon.org (Postfix) with ESMTP id ED4A9FFDC; Wed, 17 Jul 2002 13:25:52 -0700 (PDT) Message-ID: <3D35D2D0.F480C81D@pantherdragon.org> Date: Wed, 17 Jul 2002 13:25:52 -0700 From: Darren Pilgrim X-Mailer: Mozilla 4.76 [en] (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: Andrei Cojocaru Cc: Cy Schubert - CITS Open Systems Group , freebsd-hackers@FreeBSD.ORG Subject: Re: Counting the clock cycles References: <200207171943.g6HJhf4o051526@cwsys.cwsent.com> <004801c22dce$859bfa60$0300a8c0@fivehundred> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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 Andrei Cojocaru wrote: > > doesn't fit my criteria since it changes, bah I'll just use > gettimeofday since it's a portable API and hope the computers I run > it on don't change their blocks by too much... If you're really worried about it, get a GPS device that can provide you with a PPS signal for use with ntpd. Then I'd say you could safely rely on the computer's clock being accurate. > From: "Cy Schubert - CITS Open Systems Group" > > In message <00d501c22dc4$57d08b00$0200a8c0@twothousand>, "Andrei > > Cojocaru" writes: > > > I was asking around in #freebsdhelp on EFNet what the equivalent of > > > GetTickCount() in the Win32 API is in FreeBSD. > > > > > > I need a way to properly determine passage of time that is not affected if I > > > change the system clock for example. The only way I'm aware that you can do > > > that is by counting the number of clock cycles since system startup. What > > > function does that in FreeBSD? I'd also like a Linux way if possible. (that > > > is a way that will work across all UNIX clones). Thanks and please include > > > my email in the reply directly since I'm not signed up to this mailing list. > > > Thanks once again. > > > > How about time(3)? To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message