home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!munnari.oz.au!ariel.ucs.unimelb.EDU.AU!ucsvc.ucs.unimelb.edu.au!lugb!news
- Newsgroups: comp.lang.pascal
- Subject: Re: Accurate delay function
- Message-ID: <1993Jan21.231135.11961@lugb.latrobe.edu.au>
- From: CHEGC@LURE.LATROBE.EDU.AU (Graeme Cross)
- Date: Thu, 21 Jan 1993 23:11:35 GMT
- Sender: news@lugb.latrobe.edu.au (USENET News System)
- References: <fcrews.8.727570654@WES.ARMY.MIL> <1993Jan21.050905.28739@uwasa.fi>
- Organization: La Trobe University, Australia
- In-Reply-To: ts@uwasa.fi's message of Thu, 21 Jan 1993 05:09:05 GMT
- X-News-Reader: VMS NEWS 1.24
- Lines: 41
-
- In <1993Jan21.050905.28739@uwasa.fi> ts@uwasa.fi writes:
-
- > In article <fcrews.8.727570654@WES.ARMY.MIL> fcrews@WES.ARMY.MIL (FORD CREWS) writes:
- > >Does anyone have the source of a tp7 tpu for a high
- > >resolution delay function. I need one that can weight
- > >for 3 minutes then write the results to a file. Turbo's
- > >delay function seems to be several secounds off when you
- > >get in the 3 minute range. The routine needs to work on
- > >different speed machines.
- >
- > You can easily write it by reading the clock, making an loop and
- > seeing when theree minutes have elapsed. But if the problem is with
- > your PC's clock (I suspect that it is), there is no better solution
- > than the delay function.
- >
-
- There is actually a better solution: reprogram the hardware to give you a
- better timer resolution and write your own delay function from there. it is
- quite easy (once you understand the theory) to get quite respectable high
- resolution timings out of a PC.
- If you don't want to do it the hard way, there are a few files in the turbopas
- directory on Simtel-20 that have source code for high-res timing. For example,
- the BONUS507.ARC file contains a public domain high-res timer unit (I think its
- called TPTIMER.ARC). It contains all the source code and was written by Kim
- Kokkonen (from TurboPower Software), the author of Turbo & Object Professional.
- If you're after a good explanation of how to program the clock for high-res
- timing, any *good* PC hardware book will give you the info, and there have been
- articles in both Dr Dobb's Journal and PC Techniques in the last couple of
- years explaining it all.
- Note that this solution is processor-speed independant, and is useful for
- millisecond delays (which the standard TP delay function can't do - or at least
- not reliably :-).
-
- Hope this helps,
-
- Graeme
-
- Graeme Cross | chegc@lure.latrobe.edu.au
- Dept. of Chemistry |
- La Trobe University | One day, by accident or design, a .sig will
- Bundoora, Victoria, Australia | just mysteriously appear here...
-