Re: Counting the clock cycles

[ Available lists | Index of freebsd-hackers | Month of Jul 2002 | Week of 17 Jul 2002 | Raw email | View thread | Wrap long lines | Reply | Tag ]
From
Darren Pilgrim <dmp@pantherdragon.org>
Date
17 Jul 2002 13:25:55
Subject
Re: Counting the clock cycles
Message-ID
3D35D2D0.F480C81D@pantherdragon.org


[ Hide this part ]
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" <Cy.Schubert@uumail.gov.bc.ca>
> > 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



Elapsed time: 0.233 seconds