03-11-2024, 12:28 PM
@Terry - I changed the program slightly to compare the times and added a termination condition. Hope you don't mind.
Flickering: Maybe the IDE under QB 3.12 requires more memory, or generally requires more performance?
Flickering: Maybe the IDE under QB 3.12 requires more memory, or generally requires more performance?
Code: (Select All)
'Geschwindigkeitstest fuer Bilderverschieben, Terry - 11. Maerz 2024
Option _Explicit
Dim x As Integer
Dim y As Integer
Dim i As Long
Dim t As Double
Dim t1 As Double
Dim t2 As Double
Dim As Integer z
Locate 2, 2
Print "Shows how long it takes for 1 billion shifts "
Locate 3, 2
Print "with multiplication or shift."
Locate 5, 2
z = 0
x = 4
Do
i = 0
t = Timer(.001)
Do
y = x * 4
i = i + 1
Loop Until i = 1000000000 ' a billion times
t1 = Timer(.001) - t
i = 0
t = Timer(.001)
Do
y = _ShL(x, 2)
i = i + 1
Loop Until i = 1000000000
t2 = Timer(.001) - t
Beep
'Cls
Print
Print Using " #.### --> Multiplying"; t1
Print Using " #.### --> Shiting left"; t2
Locate CsrLin + 1, 2
z = z + 1
Loop Until z = 4
End