home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / lang / pascal / 8419 < prev    next >
Encoding:
Internet Message Format  |  1993-01-21  |  2.6 KB

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