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 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
|
Private Declare Function GetTickCount Lib "Kernel32" () As Long
Sub tps_execution1()
Dim depart, tps_exe
depart = GetTickCount()
Dim a As Range
For Each a In Range("a1:f10000")
a = a + 1
Next a
tps_exe = GetTickCount() - depart
MsgBox tps_exe
End Sub
Sub tps_execution2()
Dim depart, tps_exe
Dim cmpt1 As Long, cmpt2 As Long
depart = GetTickCount()
Dim a as variant
a = Range("a1:f10000")
For cmpt1 = LBound(a, 1) To UBound(a, 1)
For cmpt2 = LBound(a, 2) To UBound(a, 2)
a(cmpt1, cmpt2) = a(cmpt1, cmpt2) + 1
Next cmpt2
Next cmpt1
Range("a1:f10000") = a
tps_exe = GetTickCount() - depart
MsgBox tps_exe
End Sub
Sub tps_execution3()
Dim plage(10000, 6)Dim depart, tps_exe
Dim i As Integer, j As Integer
depart = GetTickCount()
For i = 1 To 6
For j = 1 To 1000
plage(j, i) = Cells(j, i)
Next j
Next i
For i = 1 To 6
For j = 1 To 1000
plage(j, i) = plage(j, i) + 1
Next j
Next i
For i = 1 To 6
For j = 1 To 1000
Cells(j, i) = plage(j, i)
Next j
Next i
tps_exe = GetTickCount() - depart
MsgBox tps_exe
End Sub |
Partager