TizzyT

Easy Benchmark function

Mar 2nd, 2017
203
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 0.25 KB | None | 0 0
  1.     Public Function Benchmark(ByVal Method As Action, Optional ByVal iterations As Integer = 1) As Long
  2.         Dim t As Stopwatch = Stopwatch.StartNew
  3.         For i = 1 To iterations : Method.Invoke : Next
  4.         t.Stop()
  5.         Return t.ElapsedMilliseconds
  6.     End Function
Advertisement
Add Comment
Please, Sign In to add comment