Ответить на сообщение
Вернуться к теме
Вы отвечаете на сообщение:
ник: Lukas Попробую, на примере одномерных массивов:
Private lngArr(0 To 255) As Long Private resArr(0 To 255) As Long Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" ( _ lpvDest As Any, lpvSource As Any, ByVal cbCopy As Long) Public Declare Function apiTimeGetTime Lib "winmm.dll" Alias "timeGetTime" () As Long Private Function Test1() CopyMemory resArr(0), lngArr(0), Len(lngArr(0)) * 256 End Function Private Function Test2() Dim i As Integer For i = 0 To 255 resArr(i) = lngArr(i) Next i End Function Public Sub Test3() Dim start As Long Dim j As Long, i As Long Const Z As Long = 20000 For i = 0 To 5000000 'разогрев процессора j = i Next i For i = 1 To 10 DoEvents start = apiTimeGetTime For j = 0 To Z Test1 Next j Debug.Print i, "Test1", apiTimeGetTime - start DoEvents start = apiTimeGetTime For j = 0 To Z Test2 Next j Debug.Print i, "Test2", apiTimeGetTime - start Next i End Sub
1 Test1 0 1 Test2 593 2 Test1 16 2 Test2 578 3 Test1 16 3 Test2 578 4 Test1 16 4 Test2 578 5 Test1 15 5 Test2 578 6 Test1 16 6 Test2 563 7 Test1 15 7 Test2 469 8 Test1 16 8 Test2 515 9 Test1 16 9 Test2 578 10 Test1 16 10 Test2 578
Ваше имя:
Пароль:
Сообщение:
Прикрепить:
Для вставки смайлов в текст щелкните по значку.