Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 17 Jul 2002 14:35:26 -0600
From:      "Andrei Cojocaru" <spinlock_lists@empirequest.com>
To:        "Darren Pilgrim" <dmp@pantherdragon.org>
Cc:        "Cy Schubert - CITS Open Systems Group" <Cy.Schubert@uumail.gov.bc.ca>, <freebsd-hackers@FreeBSD.ORG>
Subject:   Re: Counting the clock cycles
Message-ID:  <005f01c22dd1$7be7d180$0300a8c0@fivehundred>
References:  <200207171943.g6HJhf4o051526@cwsys.cwsent.com> <004801c22dce$859bfa60$0300a8c0@fivehundred> <3D35D2D0.F480C81D@pantherdragon.org>

next in thread | previous in thread | raw e-mail | index | archive | help
I am already synchronizing using xntp, that's not the problem. The =
problem is by some weird way the clock got out of sync by about 1hr =
during daylight switch on one of the computers I run, and I need a =
reliable way to get passage of time (I don't need date/time, just the =
passage of it) for different internal operations in the program.
----- Original Message -----=20
From: "Darren Pilgrim" <dmp@pantherdragon.org>
To: "Andrei Cojocaru" <spinlock_lists@empirequest.com>
Cc: "Cy Schubert - CITS Open Systems Group" =
<Cy.Schubert@uumail.gov.bc.ca>; <freebsd-hackers@FreeBSD.ORG>
Sent: Wednesday, July 17, 2002 14:25
Subject: Re: Counting the clock cycles


> Andrei Cojocaru wrote:
> >=20
> > 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...
>=20
> 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.
>=20
> > 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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?005f01c22dd1$7be7d180$0300a8c0>