Date: Mon, 23 Sep 1996 23:30:52 -0400 (EDT) From: Tom Sgouros To: DJ Delorie cc: djgpp AT delorie DOT com Subject: Re: PC Time In-Reply-To: <199609230149.VAA28169@delorie.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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 ). 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