GetTickCount (rtl)
De Wiki1000
(Différences entre les versions)
| Ligne 1 : | Ligne 1 : | ||
| − | <source lang='delphi'>Function GetTickCount(): | + | <source lang='delphi'>Function GetTickCount():longint;</source> |
| − | Cette fonction retourne un nombre représentant | + | Cette fonction retourne un nombre représentant un nombre de cycle processeur. Elle repose sur le compteur de performance introduit sur les processeurs Pentium et supérieur. |
{|class="wikitable" | {|class="wikitable" | ||
| Ligne 8 : | Ligne 8 : | ||
|Cette fonction retourne un nombre. | |Cette fonction retourne un nombre. | ||
|} | |} | ||
| − | |||
| − | |||
Exemple | Exemple | ||
<source lang='delphi'> | <source lang='delphi'> | ||
| + | var t1,t2:longint; | ||
begin | begin | ||
| + | t1 := GetTickCount; | ||
| + | doSomething; | ||
| + | t2 := GetTickCount; | ||
| + | showMessage(Format('doSomething takes %s ms',[TickToString(t2-t1)])); | ||
end; | end; | ||
</source> | </source> | ||
Voir aussi: | Voir aussi: | ||
| + | |||
| + | * [[TickToMS (rtl)|TickToMS]] | ||
| + | * [[TickToString (rtl)|TickToString]] | ||
{{Footer|Développement DSM}} | {{Footer|Développement DSM}} | ||
[[category:RTL Système]] | [[category:RTL Système]] | ||
Version actuelle en date du 8 janvier 2010 à 13:30
Function GetTickCount():longint;
Cette fonction retourne un nombre représentant un nombre de cycle processeur. Elle repose sur le compteur de performance introduit sur les processeurs Pentium et supérieur.
| Result | Cette fonction retourne un nombre. |
Exemple
var t1,t2:longint; begin t1 := GetTickCount; doSomething; t2 := GetTickCount; showMessage(Format('doSomething takes %s ms',[TickToString(t2-t1)])); end;
Voir aussi:
| Whos here now: Members 0 Guests 0 Bots & Crawlers 1 |