IT-Academy

Timer VBA

Nov 30th, 2017
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Public Declare Function GetTickCount Lib "kernel32.dll" () As Long
  2. Sub testTimer()
  3. Dim t As Long
  4. Dim i As Long
  5. Dim a As Long
  6.  
  7. t = GetTickCount
  8.  
  9. 'code
  10. For i = 1 To 25000000
  11. a = a + 1
  12. Next
  13. 'code
  14.  
  15. MsgBox GetTickCount - t, , "Milliseconds"
  16. End Sub
Advertisement
Add Comment
Please, Sign In to add comment