Sign in Join
Wiki copytemporary

EpikTimer/fr: what changed

Revision 2 to 3. 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-
171### A propos
182
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).
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).
204
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é.
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é.
226
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.
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.
248
259### Auteur
2610
27-[Tom Lisjac](</User:VlxAdmin> "User:VlxAdmin")
11+Tom Lisjac
2812
2913#### Contributeurs
3014
31- * [Felipe Monteiro de Carvalho](</User:Sekelsenmat> "User:Sekelsenmat")
32- * Marcel Minderhoud
15+- Felipe Monteiro de Carvalho
16+- Marcel Minderhoud
3317
3418### Licence
3519
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)
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)
3721
3822### Subversion
39-```
40-svn co https://lazarus-ccr.svn.sourceforge.net/svnroot/lazarus-ccr/components/epiktimer epiktimer
41-```
4223
24+ svn co https://lazarus-ccr.svn.sourceforge.net/svnroot/lazarus-ccr/components/epiktimer epiktimer
25+
4326### Téléchargement
4427
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>).
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).
4629
47-Statut: Production/Stable
30+Statut: Production/Stable
4831
4932### Change Log
5033
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
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
5437
55- 1. initial beta release
38+1. initial beta release
5639
57- * Version 0.2 3-7-2003 TL
40+- Version 0.2 3-7-2003 TL
5841
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.
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.
6245
63- * Version 0.3 15-11-2005
46+- Version 0.3 15-11-2005
6447
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
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
7255
73- * Version 1.0 06-10-2006
56+- Version 1.0 06-10-2006
7457
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)
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)
8164
8265### Dépendances / Configuration requise
8366
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.
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.
8669
87-Testé sur:
70+Testé sur:
8871
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.
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.
9376
94-Issues: Besoins de test sur FreeBSD et de plus vieilles machines qui manquent de matériel TSC.
77+Issues: Besoins de test sur FreeBSD et de plus vieilles machines qui manquent de matériel TSC.
9578
9679### Installation
9780
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)
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)
10285
10386### Usage
10487
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.
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.
10689
10790**If the timer is named ET**
108-```
91+
92+``` pascal
10993uses epiktimer;
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;
137-```
13894
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:
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;
140121```
122+
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
141126Function TimedExecution: Extended;
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...
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...
150135```
151136
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-```
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
154140DelayInSeconds := 8.5; // or any value
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
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
163149```
164150
165-See etdemo.pas for additional examples of component usage
151+See etdemo.pas for additional examples of component usage
166152
167153#### EpikTimer as a profiler
168154
169-EpikTimer can be used to profile the speed of procedures:
170-```
155+EpikTimer can be used to profile the speed of procedures:
156+
157+``` pascal
171158uses
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;
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;
208195```
209196
210197### The ETDemo Application
211198
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! :)
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! :)
213200
214201**Installation**
215202
216- * Open etdemo.lpi
217- * compile
218- * run
203+- Open etdemo.lpi
204+- compile
205+- run
219206
220207### Original contributors
221208
222-This page has been converted from epikwiki. Original content by [Tom Lisjac](</User:VlxAdmin> "User:VlxAdmin").
209+This page has been converted from epikwiki. Original content by Tom Lisjac.
223210
224211---
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).*
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

Back to history