Bonjour,
Je me suis fait une macro exemple pour trouver la durée d'une macro, mais je n'arrive pas à interpréter les différents résultats (voir debug.print). Pourriez-vous m'aider ?
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
Sub CalculerTemps()
    Dim NomProcedure  As String
    Dim j As Integer
 
    Dim TheTimerStart As Single
    Dim TheTimerEnd As Single
'    Dim TheTimerStart As Date
'    Dim TheTimerEnd As Date
'    Dim TheTimerStart As Double
'    Dim TheTimerEnd As Double
 
    NomProcedure = "CalculerTemps"
 
    TheTimerStart = Timer
    Debug.Print TheTimerStart & " " & NomProcedure
 
    Application.ScreenUpdating = False
    Application.DisplayAlerts = False
    Application.Cursor = xlWait
 
 
    For j = 10000 To 1 Step -1
        Debug.Print j
    Next j
 
    Application.ScreenUpdating = True
    Application.DisplayAlerts = True
    Application.Cursor = xlDefault
 
    TheTimerEnd = Timer
 
Debug.Print "Difference : " & TheTimerEnd - TheTimerStart
Debug.Print "Process completed in : " & Format(TheTimerEnd - TheTimerStart, "hh:mm:ss")
Debug.Print "Nb de minutes : " & DateDiff("n", TheTimerStart, TheTimerEnd)
Debug.Print "Nb de secondes  : " & DateDiff("s", TheTimerStart, TheTimerEnd)
Debug.Print "Durée " & NomProcedure & " " & Round((TheTimerEnd - TheTimerStart), 1) & " s"
 
MsgBox "Pause"
End Sub