🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: alt.computer.drivers.wanted
Article #129

Re: Windows 2000 Microsecond Timer Driver

#129
From: telford
Date: Wed, 24 May 2000 00:00
29 lines
3010 bytes
In alt.mud.programming CoolFish <coolfish@bigpond.com> wrote:
> Hi
> I was wondering if anyone new the answer to this
> ----------------------------------------------------------------------------
> --------------------
> Write and install a simple driver for accessing the 8254 Timer integrated
> circuit on a computer
> with an Intel Pentium (x86) processor running the WIndows 2000 or Win NT
> operatinf system.
> The driver has to provide for initialising, starting, stopping and reading
> the timer.  The timer will be
> used for timing the executions of a small segment of code within a program.

I hope I'm not too rude in saying that this is a really shithouse way to
time code execution. If you want your code to run fast and need to identify
where the time is spent then regularly interrupt the execution and look
at the program counter value (read how profiling works with linux/gcc/gprof).
After time you see which regions the program counter is most often in. 

If you have a particular chunk of code that interfaces with some realtime
device then use the parallel port -- set a pin high as you enter that
codeblock and set the pin low as you exit the codeblock. A fairly cheap
oscilloscope connected to that pin will give you much more accurate
timing than the 8254 will ever do and you have a bunch of pins to use
so you can set many `checkpoints' in your code. Also, only a single
instruction is required to toggle the parallel port so it has minimal
impact on what you are trying to measure.

	- Tel
Technical Details
Message-ID: <8ggcq7$jmp$1@hyperion.triode.net.au>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <BpnW4.40480$PL4.868525@ozemail.com.au>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 110a07,760f1893d7f968a8
X-Google-Attributes: gid110a07,public
X-Google-Thread: fae8e,760f1893d7f968a8
X-Google-Attributes: gidfae8e,public
X-Google-Thread: fffac,760f1893d7f968a8
X-Google-Attributes: gidfffac,public
X-Google-Thread: 10c4a9,760f1893d7f968a8
X-Google-Attributes: gid10c4a9,public
X-Google-Thread: 115b28,760f1893d7f968a8
X-Google-Attributes: gid115b28,public
X-Google-Thread: f9963,760f1893d7f968a8
X-Google-Attributes: gidf9963,public
X-Google-Thread: 114c70,760f1893d7f968a8
X-Google-Attributes: gid114c70,public
X-Google-Thread: 10804c,760f1893d7f968a8
X-Google-Attributes: gid10804c,public
From: <telford@xenon.triode.net.au>
Subject: Re: Windows 2000 Microsecond Timer Driver
Date: 2000/05/24
Message-ID: <8ggcq7$jmp$1@hyperion.triode.net.au>
X-Deja-AN: 626679035
Distribution: world
References: <BpnW4.40480$PL4.868525@ozemail.com.au>
X-Complaints-To: paulb@triode.net.au
X-Trace: hyperion.triode.net.au 959166087 20185 203.63.235.2 (24 May 2000 11:01:27 GMT)
Organization: Triode Internet
User-Agent: tin/pre-1.4-19990216 ("Styrofoam") (UNIX) (Linux/2.3.99-pre8 (i686))
NNTP-Posting-Date: 24 May 2000 11:01:27 GMT
Newsgroups: alt.computer.drivers.wanted,alt.mud.programming,alt.pizza.delivery.drivers,cis.winnt.drivers,fj.os.ms-windows.programming,han.comp.os.ms-windows.programming.misc,microsoft.public.ddk.win9x.printer.drivers,ru.comp.dev.pc.drivers