delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2003/03/10/05:23:49

Sender: rich AT phekda DOT freeserve DOT co DOT uk
Message-ID: <3E6C51A0.AD982E2C@phekda.freeserve.co.uk>
Date: Mon, 10 Mar 2003 08:49:36 +0000
From: Richard Dawe <rich AT phekda DOT freeserve DOT co DOT uk>
X-Mailer: Mozilla 4.77 [en] (X11; U; Linux 2.2.23 i586)
X-Accept-Language: de,fr
MIME-Version: 1.0
To: djgpp-workers AT delorie DOT com
Subject: Re: Win2K/XP uclock() - using rdtsc
References: <10303092007 DOT AA19233 AT clio DOT rice DOT edu>
Reply-To: djgpp-workers AT delorie DOT com

Hello.

Charles Sandmann wrote:
> 
> I played with this a bit.  I found out that:
> 
> When the bios tic counter is set varies widely.  I had the process busy
> waiting on the bios counter, then checking rdtsc.  For example, each tic
> took between 4.5 Million amd 117 Million cycles on my machine (in a test
> of 1000 ticks).  It missed 10 tics in that time frame (elapsed was 1010
> tics).  A normal cycle on this machine should take 24.7 Million tics.

I take it this was on the 450MHz test machine. Does the 60MHz machine behave
the same, or does it drop more BIOS tic counter updates? Basically: is the
error larger on slower machines?

[snip]
> So my question is - how accurate should we try and be?
[snip]
> Comments?  How about a 2% target, with roughly a 1/2 second calibration?
> Too long?
[snip]

Given that uclock is supposed to be a high-resolution timer, I think that
would be OK.

Having said that, we claim "less than one microsecond accuracy" on the info
page. So a 5% error probably isn't too bad: 840 ns * 1.02 = 856.8 ns; 840 ns *
1.05 = 882 ns.

Bye, Rich =]

-- 
Richard Dawe [ http://www.phekda.freeserve.co.uk/richdawe/ ]

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019