Private Sub btnGo_Click()
Dim start_time As Single
Dim stop_time As Single
Dim num_trials As Long
Dim i As Long
Dim a As Long
num_trials = CLng(txtNumTrials.Text)
lblChoose.Caption = ""
lblSelectCase.Caption = ""
DoEvents
start_time = Timer
For i = 1 To num_trials
a = Choose(1 + i Mod 10, 1, 2, 3, 4, 5, 6, 7, 8, 9, _
10)
Next i
stop_time = Timer
lblChoose.Caption = Format$(stop_time - start_time, _
"0.00") & " seconds"
DoEvents
start_time = Timer
For i = 1 To num_trials
Select Case 1 + i Mod 10
Case 1
a = 1
Case 2
a = 2
Case 3
a = 3
Case 4
a = 4
Case 5
a = 5
Case 6
a = 6
Case 7
a = 7
Case 8
a = 8
Case 9
a = 9
Case 10
a = 10
End Select
Next i
stop_time = Timer
lblSelectCase.Caption = Format$(stop_time - start_time, _
"0.00") & " seconds"
End Sub
|