[comp.sys.ibm.pc] Elapsed time finer than 55 ms on PC?

jcb@loral.UUCP (Jay Bowden) (10/09/89)

 I am hoping for information on measuring elapsed time in
 finer ticks than the clock tick (55 ms) on a standard PC
 (not AT).  Can I read the current value of the counter
 inside the 8253 that is generating the clock tick?  Even
 better would be a little code that does something like this...

 My ultimate use is to time tag bytes that come in from the
 serial port, to characterize delays (modem vs. direct, etc).

 Thanks!

 - Jay


-- 
------------------------------------------------------------------
Jay Bowden, EE/Consultant; see also Bowden Engineering
Currently contracted at Loral Instrumentation, San Diego
{ucbvax, ittvax!dcdwest, akgua, decvax, ihnp4}!ucsd!loral!jcb

press@venice.SEDD.TRW.COM (Barry Press) (10/10/89)

If you're running on an AT (and many compatibles), then  you can use the
real-time clock implemented in the CMOS RAM.  By default, it runs at 1KHz.
It's fairly simple to catch the interrupt and do the EOI stuff -- see the
BIOS source in the IBM Tech Reference for an example if needed.

dmp@attctc.Dallas.TX.US (Dan Phan) (10/11/89)

For a fairly good article on this topic, refer to "Improving the timing
resolution of an MS-DOS PC" written by Phyllis K. Lang in the July 89 issue
of the C Users Journal.  A complete C program listing is included with the 
article.

Dan.