Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!samsung!crackers!m2c!umvlsi!dime!diogenes!eli From: eli@diogenes.gang.umass.edu (Eli Brandt) Newsgroups: comp.lang.pascal Subject: Re: Timing in Turbo Pascal Message-ID: <22051@dime.cs.umass.edu> Date: 31 Oct 90 19:59:09 GMT References: <2280@oucsace.cs.OHIOU.EDU> <5307@crash.cts.com> <1308@manta.NOSC.MIL> Sender: news@dime.cs.umass.edu Reply-To: eli@diogenes.CS.UMASS.EDU (Eli Brandt) Distribution: na Organization: University of Massachusetts, Amherst Lines: 36 In article <1308@manta.NOSC.MIL> north@manta.nosc.mil.UUCP (Mark H. North) writes: >In article <5307@crash.cts.com> nkraft@crash.cts.com (Norman Kraft) writes: >> >>Before you start this project, look at Abrash's "Zen of Assembly Language". >>In the first several chapters he developes an assembler routine which does >>not depend on the BIOS, but uses timer chips in a very efficient and >>accurate way. The "ZenTimer", as it is called, achieves a resolution >>of 1 microsecond (1 millionth of a second), and uses the 8253. Abrash >>uses it to time 4 cycle assembler routines: a serious challenge, that! >> >I find this hard to believe (microsecond accuracy). There are hardware >interrupts going on at unpredictable times so unless you take over the >whole machine (memory refresh and all...) how can you be assured of accuracy >in your timer function? > >Mark > > > >F >I >L >L >E >R You may note that the original poster said uSec *resolution*, not accuracy. DRAM refresh and such will obviously perturb the results. Abrash recommends averaging several runs. If you are at all interested in '86 assembly, check out his book. You'll never again believe a compiler vendor's claim that the compiler produces code "in the same league as expert assembly-language programmers". BTW, has anybody seen a similar book discussing the 8087? Eli