Created
December 25, 2013 10:30
-
-
Save anonymous/8122017 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Dim a As Integer | |
Dim a2 As Integer | |
Dim TimeH As Float | |
Dim TimeE As Float | |
Dim r As Float | |
Dim i As Integer | |
Dim b As Boolean | |
Dim i2 As Integer | |
TimeH = Timer ' время начала теста | |
For a = 1 To 1000000 | |
For a2 = 1 To 15 | |
' используем встроенную функцию Gambas runtime | |
b = BTst(a, a2 - 1) | |
Next | |
Next | |
TimeE = Timer | |
r = TimeE - TimeH ' вычисление разницы времени | |
Print "время с использованием встроеных функций " & Str(r) | |
TimeH = Timer ' время начала теста | |
For a = 1 To 1000000 | |
For a2 = 1 To 15 | |
'i2 = (2 ^ (a2 - 1)) ' необходимо из за ошибки несоответсвия типов | |
b = a And CInteger(2 ^ (a2 - 1)) | |
Next | |
Next | |
TimeE = Timer | |
r = TimeE - TimeH ' вычисление разницы времени | |
Print "время с использованием уравнения в коде " & Str(r) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment