Re: Need to implement a calendar clock with millisecond resolution, please help.



On Sun, 26 Aug 2007 03:07:23 -0700, Hunter <Igal.Hunter@xxxxxxxxx>
wrote:

Oh... API... Whatever that means :(

http://en.wikipedia.org/wiki/API and in this case particularly
http://en.wikipedia.org/wiki/Windows_API

As for precision, do you know how much it can "drift"?
s/precision/accuracy/; see PP (previous post)

I mean, what I need is to synchronize between to programs, each
acquiring it's data from a different source (And the data rate is
about 1kHz), and saving it into the file. The programs not necessarily
start at the same time, but they do run simultaneously most of the
time. So I thought of "time stamping" the data in files.

Programs on the same machine, or different machines?

On the same machine, if that machine can be a multiprocessor -- and
any machine you bought recently in the consumer market likely was --
make sure you use a call which gets time from a 'global' or 'shared'
clock, not a per-CPU counter, since those may not be or stay in sync.
I'm confident Windows does provide such a capability, but I'm not sure
if (or when) it's the default, and if not how you get it, and since
it's implementation-specific (to Windows) it's offtopic here.
comp.programmer.ms-windows.win32 is rumored to be good.

On different machines, if you want to keep clocks in sync to the
millisecond level, you need something specialized for the purpose.
There may be some Windows-specific capability, though I haven't heard
of one; the win32 group would probably know. There is an Internet
standard (in both the de-jure and de-facto sense) for this called NTP
(Network Time Protocol), but last I looked they weren't getting very
good precision on Windows. You could try comp.protocols.time.ntp ,
and in particular www.meinberg.de reportedly supports (free) a build
and configuration for Windows from the generic/portable NTP source.
(The company's business is selling precision clock _hardware_, and
they provide this support for NTP free presumably in the hope that
lots more NTP users = somewhat more clock buyers.)

- formerly david.thompson1 || achar(64) || worldnet.att.net
.



Relevant Pages

  • Re: Does Fedora mess up the clock for Windows?
    ... the clock to match the NTP server. ... Running the AtomTime95 program under windows would probably make ... Making sure that the time zone is the same under both ...
    (Fedora)
  • Re: NTP Synchronisation Problem
    ... >> You dont say which version of Windows or include any config files so its ... >> SNTP client to an NTP server. ... >> Time service doesn't take into account clock drift, clock reliability, ...
    (comp.unix.sco.misc)
  • Re: Clock Problem?
    ... If his system gains a sec per sec ntp can ... Maybe something added something faulty in /etc/adjtime. ... and I've asked him to see if Windows handles the time correctly. ... Unless there is a file that got corrupted by changing the clock by hand ...
    (alt.os.linux.suse)
  • Re: System clock modified after crash
    ... > advance/retard the clock at daylight savings time boundaries. ... in the spring you get the pleasure of seeing windows ... > locale and show times and dates in your local time. ... Most ISPs have a local NTP server, but using NTP to stabilise is defintitely ...
    (comp.os.linux.misc)
  • Re: [PATCH/RFC 10/10] example of simple continuous gettimeofday
    ... Uses NTP to modify the clock frequency value rather then just ... > adjustment, which should be applied every f cycles. ... Your design seems to suggest keeping an NTP calculated reference time ...
    (Linux-Kernel)