alexpanoiu

Show Timer Resolution

Nov 13th, 2018 (edited)
222
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Option Explicit
  2. Option Compare Binary
  3.  
  4. Sub ShowTimerResolution()
  5.  
  6.   Dim i As Long
  7.   Dim t0 As Double, t1 As Double
  8.  
  9.   t0 = Timer
  10.   For i = 1 To 25
  11.     Do: t1 = Timer: Loop Until t1 <> t0
  12.     Debug.Print Format$(t0, "0.000000"); " / "; _
  13.       Format$(t1, "0.000000"); ": "; _
  14.       Format$((t1 - t0), "0.000000"); " ("; _
  15.       Format$(Round(1 / (t1 - t0)), "0"); ")"
  16.     t0 = t1
  17.   Next i
  18.  
  19. End Sub
Advertisement