Project | HighPrecisionTimer |
Version | v1.2 |
Date | 19th July 1999 |
Copyright, Authors | Tom
Peiffer <peiffer@rhrk.uni-kl.de> NPS <kvk@estpak.ee> Alex Abreu <simonet@bhnet.com.br> Gordon Bamber <gbamber@mistral.co.uk> |
Project type | Delphi 4 Component |
Filename | HighPrecisionTimer v1.2.zip |
Description | Invisible component that makes very high time measures possible, depending on the speed of your CPU. |
Files in zip-archiv | HighPrecisionTimer.pas HighPrecisionTimer.dcr hpThread.pas Back.gif Green.gif Demo.zip |
Copyright - Installation - General information - Usage - Properties - Methods - Events
This component is completely copyright by the authors listed above. However, you are absolutely allowed to make changes to the source, but you have to leave the names of the authors in the source files. Just add your name to the list.
Delphi 4: Unzip the files HighPrecisionTimer.pas, HighPrecisionTimer.dcr and hpThread.pas in your component directory. Go to menu Components and choose "Install component". Select the HighPrecisionTimer.pas file and click on OK. The component is placed in the "System" pallette. There are no other files needed than those contained in the zip file.
Just drop the component on your form. Assign values to either the property Frequency or TimePeriod. Place your code to the OnHighPrecisionTimer Event.
Property About: string ;
Shows a box about the authors.
Property ProcessorSpeed:Double ;
A read-only property showing the speed of your CPU.
Property HasTimeStamp:Boolean ;
Indicates if your processor is able to read time stamps. All Pentiums and AMD-K6
should be able to do so.
property Frequency : extended ;
Put in the number of Hz that you want to make time triggers. This
value is equal to the inverse of TimePeriod.
property TimePeriod : extended ;
Put in the number of seconds between two time triggers. This value is
equal to the inverse of Frequency.
property ThreadPriority : TTHreadPriority ;
Select the ThreadPriority used for make the measures. tpLower is a
good choice.
property Enabled : boolean ;
If true, then the OnhighPrecisionTimer event is triggered.
property Version : string ;
Shows the version of the component.
Procedure ShowAbout;
Shows a box whith the authors.
Procedure RefreshTimeStamp;
Refreshed the timestamp of your CPU.
Function GetTimeStamp:TLargeInteger ;
Read the timestamp of your CPU, if supported.
Function SupportsTimeStamp:Boolean;
See HasTimeStamp property.
Procedure StartTimer;
Starts the internal timer.
Procedure StopTimer;
Stops the internal timer.
Function GetElapsedTicks:Comp;
Gives you the number of ticks since the procedure StartTimer has been
called.
Function GetTicksPerSecond(ITERATIONS:Word):Comp;
For example on a 200MHz computer, 200.000.000 ticks are counted per
second.
function GetExactCpuSpeed:Double;
Read the exact MHz of your CPU.
Function GetElapsedSeconds:Double;
Gives you the number of seconds since the procedure StartTimer has
been called.
Function GetCPUSpeed:Comp;
See GetExactCpuSpeed.
property OnHighPrecisionTimer : TOnHPTimer ;
This event is triggered when the time indicated in TimePeriod has
elapsed. As parameters, you get the elapsed seconds since you've set enabled to
true, the DeltaSeconds between this and the last measure an the total number of
calls since enabled=true.
© 1999. Authors: Tom Peiffer,NPS, Alex Abreu, Gordon Bamber