Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!zaphod.mps.ohio-state.edu!mips!pacbell.com!ucsd!qualcom.qualcomm.com!maui.qualcomm.com!rdippold From: rdippold@maui.qualcomm.com (Ron Dippold) Newsgroups: comp.os.msdos.programmer Subject: Re: Accurate timing request Message-ID: <1991Mar7.025205.9213@qualcomm.com> Date: 7 Mar 91 02:52:05 GMT References: <1991Mar6.145414.8747@uwovax.uwo.ca> Sender: news@qualcomm.com Organization: Qualcomm, Inc., San Diego, CA Lines: 13 In article <1991Mar6.145414.8747@uwovax.uwo.ca> bangarth@uwovax.uwo.ca writes: >Researchers here are looking for some facility to measure time with 1 ms. >or less accuracy on an AT or 386 machine. We currently with our software >(in Turbo Pascal) can't get any better than about 3 ms. accuracy. I have heard I would suggest that you speed up the clock ticks. Currently they occur 18.2 times a second, but you can speed it up so that they occur 1000 times a second or more, as the timer is programmable. Your interrupt routine will need to scale whatever timer value you use down to the expected value and pass that on to the old timer. For example, if you speed up the timer 128 times, you will need to call the old interrupt vector every 128 actual ticks. You can get some great accuracy this way, just keep in mind that the faster you interrupt the processor, the more machine power it gobbles up.