Mail Archives: djgpp/1996/09/23/23:47:52
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 -