public class Test
public Shared Sub Main
Const TRIALS As Integer = 10000000
Dim start_time As DateTime
Dim stop_time As DateTime
Dim elapsed_time As TimeSpan
Dim i As Integer
start_time = Now
For i = 1 To TRIALS
Next i
stop_time = Now
elapsed_time = stop_time.Subtract(start_time)
Console.WriteLine(elapsed_time.TotalSeconds.ToString("0.000000"))
start_time = Now
For i = 1 To TRIALS
Next i
stop_time = Now
elapsed_time = stop_time.Subtract(start_time)
Console.WriteLine(elapsed_time.TotalSeconds.ToString("0.000000"))
End Sub
End class
|