home *** CD-ROM | disk | FTP | other *** search
/ CD Shareware Magazine 1996 December / CD_shareware_12-96.iso / WIN / Programa / FTIMER.ZIP / FTCODE.TXT < prev   
Encoding:
Text File  |  1996-08-14  |  2.9 KB  |  80 lines

  1. Component:     TFTimer
  2. Description:    Fast timer component for Delphi16
  3. Author:        Richard Shotbolt
  4. Email:        100327,2305@compuserve.com
  5. Date:        14 Aug 1996
  6.  
  7. TFTimer is a fast timer component which uses the MMSYSTEM timer routines
  8. to achieve an interval down to 1ms instead of the 55ms minimum for TTimer.
  9.  
  10. This control is unusual in that it uses some unconventional techniques
  11. with data segments and arrays of event handlers to circumvent the normal
  12. requirement for a DLL in this type of control. Because of its somewhat
  13. experimental nature I am releasing the source code as freeware in the hope
  14. that more experienced programmers than myself can assess it and provide
  15. feedback. I am therefore not accepting any responsibility for system crashes
  16. or loss of data. Having said that, I have carried out many tests such as
  17. creating and destroying on-the-fly, multiple instances and running multiple
  18. copies of the same program, alt-tabbing, running other programs etc. under
  19. Win3.1 and Win95 and I have not managed to make it fall over.
  20.  
  21. Thanks are due to Immo Wache for the TRtcTimer component which provided
  22. some interesting ideas to build on.
  23.  
  24. << Using TFTimer >>
  25.  
  26. TFTimer has the properties, methods and events of TTimer but with some
  27. additions and extensions.
  28.  
  29. ---------------------------------------------------------------------
  30.  
  31. << Properties >>
  32.  
  33. ---------------------------------------------------------------------
  34.  
  35. Enabled: Boolean;
  36. Starts/stops the timer. Default is True.
  37.  
  38. Interval: Word;
  39. Sets the delay in milliseconds. The minimum cannot be set lower than 
  40. the system is capable of. Most new machines can achieve 1ms, but beware
  41. of running out of resources. Default is 1000 (1 sec).
  42.  
  43. Resolution: Word;
  44. Sets the accuracy of timing. Smaller values eat up more processor time.
  45. Default is 5ms. 
  46.  
  47. Countdown: Integer;
  48. The timer continues to fire events until Countdown has decremented to zero.
  49. You can make it one-shot by setting Countdown to 1. If negative, the timer
  50. runs continuously. Default is -1.
  51.  
  52. MaxTime: Word;
  53. Read only. Returns the maximum interval that can be set.
  54.  
  55. MinTime: Word;
  56. Read only. Returns the minimum interval that can be set.
  57.  
  58. ---------------------------------------------------------------------
  59.  
  60. << Event >>
  61.  
  62. ---------------------------------------------------------------------
  63.  
  64. OnTimer: TNotifyEvent;
  65. This is the timer event and is the same as for TTimer
  66.  
  67. ---------------------------------------------------------------------
  68.  
  69. << Installation >>
  70.  
  71. Backup your 'complib.dcl' file as a precaution.
  72. Select 'Options', 'Install Components'.
  73. Select 'Add', 'Browse'.
  74. Select the directory containing the ftcode files.
  75. Select 'ftcode.pas' and click OK on each box that appears.
  76. The FTimer control will be added to the 'System' section of your
  77. component toolbar.
  78. If anything goes wrong, restore your backed-up complib.dcl and try
  79. again after correcting any obvious problems.
  80.