Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ames!pasteur!agate!ucbvax!hplabs!hpda!hpcupt1!dclaar From: dclaar@hpcupt1.HP.COM (Doug Claar) Newsgroups: comp.sys.ibm.pc Subject: Re: Precise loop timing on PC? Message-ID: <5930025@hpcupt1.HP.COM> Date: 9 Feb 89 18:36:51 GMT References: <5930024@hpcupt1.HP.COM> Organization: Hewlett Packard, Cupertino Lines: 26 I received mail that indicated that DRAM refresh and the pre-fetch queue make this difficult to do. Another reply suggested polling the timer, but that would seem to slow down the loop. One variation on this that I thought of (well, actually, basic does something like this) is to grab the timer interrupt and boost the timer rate. I would then call the real timer interrupt every N times the timer ticks, where N is how much faster my new timer is going. old timer: _________|_________|_________|_________|_________|_________| new timer: _|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_| counter: 5 4 3 2 1 0 timer code: do my stuff; decrement counter; if counter = 0 call old timer set counter to 5 end Doug Claar HP Computer Systems Division UUCP: mcvax!decvax!hplabs!hpda!dclaar -or- ucbvax!hpda!dclaar ARPA: dclaar%hpda@hplabs.HP.COM