Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

time

5 views
Skip to first unread message

bob

unread,
Jun 3, 2012, 8:38:44 AM6/3/12
to
Can someone help me understand why a computer's clock is so inaccurate?

And, what are the best ways to cope with this when you need good timing?

Is there maybe a USB stick or something that can offer better timing?

Dmitry A. Kazakov

unread,
Jun 3, 2012, 8:46:56 AM6/3/12
to
On Sun, 3 Jun 2012 05:38:44 -0700 (PDT), bob wrote:

> Can someone help me understand why a computer's clock is so inaccurate?

Inaccurate or imprecise?

> And, what are the best ways to cope with this when you need good timing?

That depends on the requirements. There are many time sources a modern
CPU/motherboard had. The OSes tend to use the worst of them available
(:-)). Which is why system time services may appear so disappointing.

Anyway the answer depends on the hardware (x86, PPC), the OS, and what are
you going to achieve.

--
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de

Sjouke Burry

unread,
Jun 3, 2012, 12:21:00 PM6/3/12
to
bob <b...@coolfone.comze.com> wrote in news:2a38a1da-0263-41a0-8787-
784bb0...@googlegroups.com:

> Can someone help me understand why a computer's clock is so inaccurate?
>
> And, what are the best ways to cope with this when you need good timing?
>
> Is there maybe a USB stick or something that can offer better timing?
>

Money. The cheapest possible clock chip.
See if you can find a pci clock card.
I just last week started up an old indutrial computer after 4 years.
Clock still richt to the minute.

Daniel Pitts

unread,
Jun 3, 2012, 4:39:55 PM6/3/12
to
Bob, if this is still about synchronizing videos, then you're going way
to deep (NTP, better clocks, etc...)

You can synchronize videos much more simply than that. Human perception
is likely *far* less accurate and far more forgiving than the system time.

Dmitry A. Kazakov

unread,
Jun 4, 2012, 3:45:26 AM6/4/12
to
Theoretically yes. I read somewhere that for the human eye 50Hz is the
upper limit it could capture. This makes about 200ms.

But in reality it is not that simple. I designed several software
oscilloscopes and driver's aid systems. For example, the jitter of the
oscilloscope's sweeping is still detectable way under 50ms. It should be
about 10ms refresh with >5ms jitter to appear running smoothly. For videos
this limit should likely be much less tight, 50ms I would say.

Now, back to the clocks. System clocks are indeed miserable. A typical
implementation, e.g. under VxWorks (a respectable real-time OS, BTW), is
that the clock is updated from the PIT (programmable interrupt timer).
Which gives a catastrophic resolution. Under Windows XP clock has 1ms
resolution, a disgrace for a multiple GHz CPU [*].

Should 1ms clock resolution impose a problem for video playback? It is hard
to tell, but 1ms looks OK. For data acquisition it is unacceptable. There
are commercial solutions using the RTS clock for time stamping (like
performance counters under Windows). These give >1us clock resolution.

-----------------
* A simple clock test is in pseudo code:

T1 = Clock;
for (;;) {
T2 = Clock;
if (T1 != T2) break;
}

Print T2 - T1.

Dmitry A. Kazakov

unread,
Jun 4, 2012, 10:18:45 AM6/4/12
to
On Mon, 4 Jun 2012 09:45:26 +0200, Dmitry A. Kazakov wrote:

> Theoretically yes. I read somewhere that for the human eye 50Hz is the
> upper limit it could capture. This makes about 200ms.

20ms, sorry.
0 new messages