Chronomètre
Chronomètre
Syntaxe :
Call Chronometre ("start")
puis Msgbox Chronometre ("stop") & " millisecondes"
'/
'/ A placer dans la partie déclarative
'/
Declare Function GetTime Lib "winmm.dll" Alias "timeGetTime" () As Long
Function Chronometre(START_or_STOP As String) As Long
Static StartTime As Long
Select Case START_or_STOP
Case Is = "START"
StartTime = GetTime()
Case Is = "STOP"
Chronometre = GetTime() - StartTime
End Select
End Function
Autre méthode :
Call Chronometre (False)
puis Msgbox Chronometre (True) & " millisecondes"
'/
'/ A placer dans la partie déclarative
'/
Declare Function GetTickCount Lib "kernel32" () As Long
Function Chronometre(False_Puis_True As Boolean) As Long
Static Compteur As Long
If False_Puis_True = False Then
Compteur = GetTickCount
Else
CalculTemps = GetTickCount - Compteur
End If
End Function
Dernière modification : 08/02/2010 02:08
Catégorie : Les mémos - Dates - Heures
Page lue 10449 fois