home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Programming Tool Box
/
SIMS_2.iso
/
bp_2_94
/
vbwin
/
ccall
/
vbbench
/
vbbench1.txt
< prev
Wrap
Text File
|
1994-01-24
|
3KB
|
143 lines
Option Explicit
Sub SearchDouble_Click ()
Static a#(1 To 13)
Dim l&, i%
Dim TimeVal#
a#(1) = 3.1415
a#(2) = 6.283
a#(3) = 12.566
a#(4) = 25.132
a#(5) = 50.264
a#(6) = 100.528
a#(7) = 201.056
a#(8) = 402.112
a#(9) = 804.224
a#(10) = 1608.448
a#(11) = 3216.896
a#(12) = 6433.792
a#(13) = 12867.584
' Start der Zeitmessung
TimeVal# = Now
For l& = 1 To 200000
For i% = 1 To 13
If a#(i%) = 2.718281 Then Exit For
Next i%
Next l&
TimeVal# = Now - TimeVal#
MsgBox ("Ende der Berechnung. Zeit: " + Str$(Int(TimeVal# * 8640000) / 100) + " Sek.")
End Sub
Sub SearchFloat_Click ()
Static a!(1 To 13)
Dim l&, i%
Dim TimeVal#
a!(1) = 3.1415
a!(2) = 6.283
a!(3) = 12.566
a!(4) = 25.132
a!(5) = 50.264
a!(6) = 100.528
a!(7) = 201.056
a!(8) = 402.112
a!(9) = 804.224
a!(10) = 1608.448
a!(11) = 3216.896
a!(12) = 6433.792
a!(13) = 12867.584
' Start der Zeitmessung
TimeVal# = Now
For l& = 1 To 200000
For i% = 1 To 13
If a!(i%) = 2.718281 Then Exit For
Next i%
Next l&
TimeVal# = Now - TimeVal#
MsgBox ("Ende der Berechnung. Zeit: " + Str$(Int(TimeVal# * 8640000) / 100) + " Sek.")
End Sub
Sub SearchInteger_Click ()
Static a%(1 To 13)
Dim l&, i%
Dim TimeVal#
a%(1) = 4
a%(2) = 9
a%(3) = 19
a%(4) = 39
a%(5) = 79
a%(6) = 159
a%(7) = 319
a%(8) = 639
a%(9) = 1279
a%(10) = 2559
a%(11) = 5119
a%(12) = 10239
a%(13) = 20479
' Start der Zeitmessung
TimeVal# = Now
For l& = 1 To 200000
For i% = 1 To 13
If a%(i%) = 12345 Then Exit For
Next i%
Next l&
TimeVal# = Now - TimeVal#
MsgBox ("Ende der Berechnung. Zeit: " + Str$(Int(TimeVal# * 8640000) / 100) + " Sek.")
End Sub
Sub SearchLong_Click ()
Static a&(1 To 13)
Dim l&, i%
Dim TimeVal#
a&(1) = 262144
a&(2) = 524288
a&(3) = 1048576
a&(4) = 2097152
a&(5) = 4194304
a&(6) = 8388608
a&(7) = 16777216
a&(8) = 33554432
a&(9) = 67108864
a&(10) = 134217728
a&(11) = 268435456
a&(12) = 536870912
a&(13) = 1073741824
' Start der Zeitmessung
TimeVal# = Now
For l& = 1 To 200000
For i% = 1 To 13
If a&(i%) = 1234567890 Then Exit For
Next i%
Next l&
TimeVal# = Now - TimeVal#
MsgBox ("Ende der Berechnung. Zeit: " + Str$(Int(TimeVal# * 8640000) / 100) + " Sek.")
End Sub
Sub SearchString_Click ()
Static a$(1 To 13)
Dim l&, i%
Dim TimeVal#
a$(1) = "Buchheit"
a$(2) = "Dudek"
a$(3) = "Jung"
a$(4) = "Kopf"
a$(5) = "Kreisel"
a$(6) = "Maslo"
a$(7) = "Monadjemi"
a$(8) = "Ramm"
a$(9) = "Reinartz"
a$(10) = "SteingrΣber"
a$(11) = "Tischer"
a$(12) = "Waldmeyer"
a$(13) = "Zoschke"
' Start der Zeitmessung
TimeVal# = Now
For l& = 1 To 200000
For i% = 1 To 13
If a$(i%) = "Gates" Then Exit For
Next i%
Next l&
TimeVal# = Now - TimeVal#
MsgBox ("Ende der String-Suche. Zeit: " + Str$(Int(TimeVal# * 8640000) / 100) + " Sek.")
End Sub