www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/09/23/23:47:52

Date: Mon, 23 Sep 1996 23:30:52 -0400 (EDT)
From: Tom Sgouros <tomss AT ids DOT net>
To: DJ Delorie <dj AT delorie DOT com>
cc: djgpp AT delorie DOT com
Subject: Re: PC Time
In-Reply-To: <199609230149.VAA28169@delorie.com>
Message-ID: <Pine.SUN.3.95.960923232748.4132B-100000@conan.ids.net>
MIME-Version: 1.0

On Sun, 22 Sep 1996, DJ Delorie wrote:

> 
> > Can anyone clear up for me the real-time issues on a PC? This is how I
> > understand it: There is a clock that ticks 18.2 times a second, and though
> > there are functions that provide more precision (e.g. uclock()), they
> > are no more accurate. Is this true?
> 
> This is not true.
> 
> There is one clock in a PC and it ticks (effectively) 1,193,180 times
> a second (UCLOCKS_PER_SEC in <time.h>).

Stupid question, but I have to ask it for clarity: Is this true no matter
how many MHz your PC is running at?

> 
> A counter divides that by 65,536 to give you 18.2065 interrupts per
> second.  clock() multiplies this by five to give an integer
> approximate for CLOCKS_PER_SEC of 91.
> 
> uclock() reads both the divide counter and the tick counter to give
> you 0.838 microsecond accuracy.
> 
> P.S.  Before anyone argues my numbers, note that this is based on the
> FAQ of 0x1800b0 tics per day, and the counter is reprogrammed for mode
> 2 operation.

Do you have a reference where I can learn more about these modes and FAQs?
(This is not FAQ=Frequently Asked Question?)

Many thanks for your reply. This has been a quite confusing issue for me.

---------------------------------------------------------------------
tomss AT ids DOT net - 401-861-2831 - 42 Forge Road, Potowomut, RI 02818 USA

- Raw text -


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