Sign in Join
Wiki copytemporary

EpikTimer/fr: what changed

Revision 1 to 2. Removed lines have a minus sign; added lines have a plus sign.

OldNewLine
1+## Contents
2+
3+ * 1 A propos
4+ * 2 Auteur
5+ * 2.1 Contributeurs
6+ * 3 Licence
7+ * 4 Subversion
8+ * 5 Téléchargement
9+ * 6 Change Log
10+ * 7 Dépendances / Configuration requise
11+ * 8 Installation
12+ * 9 Usage
13+ * 9.1 EpikTimer as a profiler
14+ * 10 The ETDemo Application
15+ * 11 Original contributors
16+
117### A propos
218
3-EpikTimer un chronomètre pour le programmeur qui est capable de mesurer des événements très court avec une précision traçable sur de longues périodes de temps. Il est simple à utiliser, consomme pratiquement pas de temps processeur et ne nécessite que 25 octets de RAM pour mettre en œuvre une instance de l'horloge. Le composant fournit un seul temporisateur interne... mais un nombre illimité peut être déclarée extérieurement et lié à un seul composant EpikTimer sur le formulaire(form).
19+EpikTimer un chronomètre pour le programmeur qui est capable de mesurer des événements très court avec une précision traçable sur de longues périodes de temps. Il est simple à utiliser, consomme pratiquement pas de temps processeur et ne nécessite que 25 octets de RAM pour mettre en œuvre une instance de l'horloge. Le composant fournit un seul temporisateur interne... mais un nombre illimité peut être déclarée extérieurement et lié à un seul composant EpikTimer sur le formulaire(form).
420
5-Le téléchargement contient le composant, un paquet d'installation et une application de démonstration, qui illustre les caractéristiques du composante ainsi que certains outils pour évaluer les sources d'horloge sur un système donné.
21+Le téléchargement contient le composant, un paquet d'installation et une application de démonstration, qui illustre les caractéristiques du composante ainsi que certains outils pour évaluer les sources d'horloge sur un système donné.
622
7-Ce composant a été conçu pour des applications multi-plateformes et a été écrit spécifiquement pour l'IDE Lazarus et le compilateur Free Pascal et comprend une application de démonstration.
23+Ce composant a été conçu pour des applications multi-plateformes et a été écrit spécifiquement pour l'IDE Lazarus et le compilateur Free Pascal et comprend une application de démonstration.
824
925### Auteur
1026
11-Tom Lisjac
27+[Tom Lisjac](</User:VlxAdmin> "User:VlxAdmin")
1228
1329#### Contributeurs
1430
15-- Felipe Monteiro de Carvalho
16-- Marcel Minderhoud
31+ * [Felipe Monteiro de Carvalho](</User:Sekelsenmat> "User:Sekelsenmat")
32+ * Marcel Minderhoud
1733
1834### Licence
1935
20-[LGPL](http://www.opensource.org/licenses/lgpl-license.php) (veuillez contacter l'auteur si la licence LGPL ne correspond pas avec la licence de votre projet)
36+[LGPL](<http://www.opensource.org/licenses/lgpl-license.php>) (veuillez contacter l'auteur si la licence LGPL ne correspond pas avec la licence de votre projet)
2137
2238### Subversion
23-
24- svn co https://lazarus-ccr.svn.sourceforge.net/svnroot/lazarus-ccr/components/epiktimer epiktimer
39+```
40+svn co https://lazarus-ccr.svn.sourceforge.net/svnroot/lazarus-ccr/components/epiktimer epiktimer
41+```
2542
2643### Téléchargement
2744
28-La dernière version stable peut être trouvée sur la [page des fichiers Lazarus CCR](http://sourceforge.net/project/showfiles.php?group_id=92177) ou [ici](http://sourceforge.net/project/showfiles.php?group_id=92177&package_id=98235).
45+La dernière version stable peut être trouvée sur la [page des fichiers Lazarus CCR ](<http://sourceforge.net/project/showfiles.php?group_id=92177>) ou [ici](<http://sourceforge.net/project/showfiles.php?group_id=92177&package_id=98235>).
2946
30-Statut: Production/Stable
47+Statut: Production/Stable
3148
3249### Change Log
3350
34-- Initially written on 24-06-2003 TL
35-- Pre-release 30-06-2003 TL - Needs testing on the BSD's and Win32
36-- Version 0.1 1-7-2003 TL
51+ * Initially written on 24-06-2003 TL
52+ * Pre-release 30-06-2003 TL - Needs testing on the BSD's and Win32
53+ * Version 0.1 1-7-2003 TL
3754
38-1. initial beta release
55+ 1. initial beta release
3956
40-- Version 0.2 3-7-2003 TL
57+ * Version 0.2 3-7-2003 TL
4158
42-1. Revised logic around hardware detection to prevent executing extended instructions if the HasCapabilityData call returns false.
43-2. Removed exposed low level diagnositic functions from unit interface.
44-3. Revised demo.
59+ 1. Revised logic around hardware detection to prevent executing extended instructions if the HasCapabilityData call returns false.
60+ 2. Removed exposed low level diagnositic functions from unit interface.
61+ 3. Revised demo.
4562
46-- Version 0.3 15-11-2005
63+ * Version 0.3 15-11-2005
4764
48-1. Updated 0.2 version to make it compile on the latest Lazarus (0.9.10).
49-2. Added LCL to the required packages.
50-3. Changed mode to Delphi in order to compile.
51-4. Changed windows timebase to use QueryPerformanceCounter, because has a much greater precision then GetSystemTime.
52-5. Added changes to ensure the component compiles on Delphi 7.0
53-6. Made tests on Windows and Linux
54-7. Small changes to the demo to make it compile
65+ 1. Updated 0.2 version to make it compile on the latest Lazarus (0.9.10).
66+ 2. Added LCL to the required packages.
67+ 3. Changed mode to Delphi in order to compile.
68+ 4. Changed windows timebase to use QueryPerformanceCounter, because has a much greater precision then GetSystemTime.
69+ 5. Added changes to ensure the component compiles on Delphi 7.0
70+ 6. Made tests on Windows and Linux
71+ 7. Small changes to the demo to make it compile
5572
56-- Version 1.0 06-10-2006
73+ * Version 1.0 06-10-2006
5774
58-1. Changes for 64 bits operation
59-2. Added units BaseUnix, Unix and UnixUtil, removed oldlinux (obsolete)
60-3. Gettimeofday -\> fpGettimeofday
61-4. Changed systemsleep for 64 bits systems
62-5. Some changes in timeval
63-6. Tested on AMD64 (linux)
75+ 1. Changes for 64 bits operation
76+ 2. Added units BaseUnix, Unix and UnixUtil, removed oldlinux (obsolete)
77+ 3. Gettimeofday -> fpGettimeofday
78+ 4. Changed systemsleep for 64 bits systems
79+ 5. Some changes in timeval
80+ 6. Tested on AMD64 (linux)
6481
6582### Dépendances / Configuration requise
6683
67-- la résolution nanoseconde est prise en charge sur les versions Intel Pentium avec un compteur d'évènements dans le temps.
68-- l'horloge système microseconde est la base de temps par défaut.
84+ * la résolution nanoseconde est prise en charge sur les versions Intel Pentium avec un compteur d'évènements dans le temps.
85+ * l'horloge système microseconde est la base de temps par défaut.
6986
70-Testé sur:
87+Testé sur:
7188
72-- Pentium IV 3,2Mhz sur Windows et Linux avec une grande précision (~ 3,220,000,000 impulsions par seconde)
73-- Pentium 233Mhz avec Damn Small Linux. Fonctionne merveilleusement avec l'horloge matérielle.
74-- Mobile AMD 64 Athlon 3200+ sur Windows XP Home (32 bit), Lazarus 9.13
75-- AMD 64 CPU, exécution de la version 64 bit d'Ubuntu Linux, Lazarus 9.18.
89+ * Pentium IV 3,2Mhz sur Windows et Linux avec une grande précision (~ 3,220,000,000 impulsions par seconde)
90+ * Pentium 233Mhz avec Damn Small Linux. Fonctionne merveilleusement avec l'horloge matérielle.
91+ * Mobile AMD 64 Athlon 3200+ sur Windows XP Home (32 bit), Lazarus 9.13
92+ * AMD 64 CPU, exécution de la version 64 bit d'Ubuntu Linux, Lazarus 9.18.
7693
77-Issues: Besoins de test sur FreeBSD et de plus vieilles machines qui manquent de matériel TSC.
94+Issues: Besoins de test sur FreeBSD et de plus vieilles machines qui manquent de matériel TSC.
7895
7996### Installation
8097
81-- In Components/Open Package File, open etpackage.lpk.
82-- Compile the component to verify that everything is there.
83-- Install and let Lazarus rebuild
84-- Component will be in the System Palette (stopwatch-ruler icon)
98+ * In Components/Open Package File, open etpackage.lpk.
99+ * Compile the component to verify that everything is there.
100+ * Install and let Lazarus rebuild
101+ * Component will be in the System Palette (stopwatch-ruler icon)
85102
86103### Usage
87104
88-Drop the component on a form. The component contains a single timer instance and parameterless calls to start, stop, elapsed and clear will implicitly reference it.
105+Drop the component on a form. The component contains a single timer instance and parameterless calls to start, stop, elapsed and clear will implicitly reference it.
89106
90107**If the timer is named ET**
91-
92-``` pascal
108+```
93109uses epiktimer;
94-
95-var
96- ET: TEpikTimer;
97-
98-procedure InitTimer;
99-begin
100- ET := TEpikTimer.Create(Application);
101-end;
102-
103-procedure InstrumentedCall;
104-Begin
105- ET.Clear; // optional... timer is cleared at creation
106- ET.Start;
107- ExecuteFirstTimedSection;
108- ET.Stop; // the timer is actually paused and can be restarted later
109- TimedSection1:=ET.Elapsed; // store the elapsed in a global
110- MakeAnUntimedOverheadCall; // not counted in the timer
111- ET.Start; //resume the timer... continue accumulating ticks
112- CallTimedSection2;
113- TimedSection2:=ET.Elapsed; //timer keeps running... we've just sample it.
114- CallTimedSection3;
115- CallSomethingElse;
116- TimedSection3:=ET.Elapsed; //keep counting... tap the elapsed
117- CallTimedSection4;
118- TimedSection4:=ET.Elapsed; //keep counting... tap the elapsed
119- ET.clear // done... timer is stopped and zeroed
120-end;
110+
111+ var
112+ ET: TEpikTimer;
113+
114+ procedure InitTimer;
115+ begin
116+ ET := TEpikTimer.Create(Application);
117+ end;
118+
119+ procedure InstrumentedCall;
120+ Begin
121+ ET.Clear; // optional... timer is cleared at creation
122+ ET.Start;
123+ ExecuteFirstTimedSection;
124+ ET.Stop; // the timer is actually paused and can be restarted later
125+ TimedSection1:=ET.Elapsed; // store the elapsed in a global
126+ MakeAnUntimedOverheadCall; // not counted in the timer
127+ ET.Start; //resume the timer... continue accumulating ticks
128+ CallTimedSection2;
129+ TimedSection2:=ET.Elapsed; //timer keeps running... we've just sample it.
130+ CallTimedSection3;
131+ CallSomethingElse;
132+ TimedSection3:=ET.Elapsed; //keep counting... tap the elapsed
133+ CallTimedSection4;
134+ TimedSection4:=ET.Elapsed; //keep counting... tap the elapsed
135+ ET.clear // done... timer is stopped and zeroed
136+ end;
121137```
122138
123-You can also create any number of timers from a single component on the form by declaring a TimerData record and passing it as a parameter to start, stop, elapsed and clear using the overloaded methods in the component. An example would be:
124-
125-``` pascal
139+You can also create any number of timers from a single component on the form by declaring a TimerData record and passing it as a parameter to start, stop, elapsed and clear using the overloaded methods in the component. An example would be:
140+```
126141Function TimedExecution: Extended;
127-Var
128- DiskAccessTime:TimerData;
129-Begin
130- ET.Clear(DiskAccessTimer); // Declared timers *must* be cleared before use.
131- ET.Start(DiskAccessTimer);
132- ExecuteTheTimedSection;
133- Result:=ET.Elapsed(DiskAccessTimer); // the timer keeps running...
134- etc...
142+ Var
143+ DiskAccessTime:TimerData;
144+ Begin
145+ ET.Clear(DiskAccessTimer); // Declared timers *must* be cleared before use.
146+ ET.Start(DiskAccessTimer);
147+ ExecuteTheTimedSection;
148+ Result:=ET.Elapsed(DiskAccessTimer); // the timer keeps running...
149+ etc...
135150```
136151
137-One particular use for EpikTimer is checking if a given amount of time has elapsed before continuing with a task or to another iteration of the same task.
138-
139-``` pascal
152+One particular use for EpikTimer is checking if a given amount of time has elapsed before continuing with a task or to another iteration of the same task.
153+```
140154DelayInSeconds := 8.5; // or any value
141-OldTime := ET.Elapse;
142-
143-while ((ET.Elapsed - OldTime) < DelayInSeconds) do
144-begin
145- ET.SystemSleep(10);
146-end;
147-
148-// DelayInSeconds has elapsed and now you can continue executing the code
155+ OldTime := ET.Elapse;
156+
157+ while ((ET.Elapsed - OldTime) < DelayInSeconds) do
158+ begin
159+ ET.SystemSleep(10);
160+ end;
161+
162+ // DelayInSeconds has elapsed and now you can continue executing the code
149163```
150164
151-See etdemo.pas for additional examples of component usage
165+See etdemo.pas for additional examples of component usage
152166
153167#### EpikTimer as a profiler
154168
155-EpikTimer can be used to profile the speed of procedures:
156-
157-``` pascal
169+EpikTimer can be used to profile the speed of procedures:
170+```
158171uses
159- {$ifdef PROFILING}epiktimer,{$endif}
160- ...
161-
162-type
163- TMyClass = class
164- private
165- {$ifdef PROFILING}
166- profiler: Tepiktimer;
167- {$endif}
168- ...
169- end;
170-
171-implementation
172-
173-constructor TMyClass.Create(AOwner: TComponent);
174-begin
175- inherited Create(AOwner);
176-
177- ...
178-
179- {$ifdef CARDROOM_PROFILING}
180- profiler := TEpikTimer.Create(Self)
181- {$endif}
182-end;
183-
184-procedure TMyClass.MethodToBeProfiled;
185-begin
186- {$ifdef PROFILING}
187- profiler.Clear;
188- profiler.Start;
189- {$endif}
190- // do stuff
191- {$ifdef PROFILING}
192- OPDebugLn('TMyClass.MethodToBeProfiled ' + FloatToStr(profiler.Elapsed));
193- {$endif}
194-end;
172+ {$ifdef PROFILING}epiktimer,{$endif}
173+ ...
174+
175+ type
176+ TMyClass = class
177+ private
178+ {$ifdef PROFILING}
179+ profiler: Tepiktimer;
180+ {$endif}
181+ ...
182+ end;
183+
184+ implementation
185+
186+ constructor TMyClass.Create(AOwner: TComponent);
187+ begin
188+ inherited Create(AOwner);
189+
190+ ...
191+
192+ {$ifdef CARDROOM_PROFILING}
193+ profiler := TEpikTimer.Create(Self)
194+ {$endif}
195+ end;
196+
197+ procedure TMyClass.MethodToBeProfiled;
198+ begin
199+ {$ifdef PROFILING}
200+ profiler.Clear;
201+ profiler.Start;
202+ {$endif}
203+ // do stuff
204+ {$ifdef PROFILING}
205+ OPDebugLn('TMyClass.MethodToBeProfiled ' + FloatToStr(profiler.Elapsed));
206+ {$endif}
207+ end;
195208```
196209
197210### The ETDemo Application
198211
199-The ETDemo application does not require EpikTimer to be installed in order to compile and operate. I never liked having to install a palette full of components only to find out that I didn't like any of them! :)
212+The ETDemo application does not require EpikTimer to be installed in order to compile and operate. I never liked having to install a palette full of components only to find out that I didn't like any of them! :)
200213
201214**Installation**
202215
203-- Open etdemo.lpi
204-- compile
205-- run
216+ * Open etdemo.lpi
217+ * compile
218+ * run
206219
207220### Original contributors
208221
209-This page has been converted from epikwiki. Original content by Tom Lisjac.
222+This page has been converted from epikwiki. Original content by [Tom Lisjac](</User:VlxAdmin> "User:VlxAdmin").
210223
211224---
212-*From the Free Pascal wiki, page "EpikTimer/fr", as it stood on 2020-02-14 after a change by Trev, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).*
213-Category: Components/fr
225+*From the Free Pascal wiki, page "EpikTimer/fr", as the Internet Archive kept it on 2023-03-30. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).*

Back to history