Private Sub BitwiseBenchmark()
' Perform a benchmark of the bitwise binary functions.
'See also:
' XorValuesBenchmark Subroutine
Dim lngMax As Long
Dim lngTry As Long
Dim varRtn As Variant
lngMax = 4096
Debug.Print "Count = " & lngMax
Debug.Print "AND: ";
DebugTimerOn
For lngTry = 1 To lngMax
varRtn = AndValues(34, 45)
Next lngTry
Debug.Print DebugTimerOff
Debug.Print "EQV: ";
DebugTimerOn
For lngTry = 1 To lngMax
varRtn = EqvValues(34, 45)
Next lngTry
Debug.Print DebugTimerOff
Debug.Print "IMP: ";
DebugTimerOn
For lngTry = 1 To lngMax
varRtn = ImpValues(34, 45)
Next lngTry
Debug.Print DebugTimerOff
Debug.Print "NAND: ";
DebugTimerOn
For lngTry = 1 To lngMax
varRtn = NandValues(34, 45)
Next lngTry
Debug.Print DebugTimerOff
Debug.Print "NOR: ";
DebugTimerOn
For lngTry = 1 To lngMax
varRtn = NorValues(34, 45)
Next lngTry
Debug.Print DebugTimerOff
Debug.Print "NOT: ";
DebugTimerOn
For lngTry = 1 To lngMax
varRtn = NotValue(34)
Next lngTry
Debug.Print DebugTimerOff
Debug.Print "OR: ";
DebugTimerOn
For lngTry = 1 To lngMax
varRtn = OrValues(34, 45)
Next lngTry
Debug.Print DebugTimerOff
Debug.Print "XOR: ";
DebugTimerOn
For lngTry = 1 To lngMax
varRtn = XorValues(34, 45)
Next lngTry
Debug.Print DebugTimerOff
Debug.Print "GET: ";
DebugTimerOn
For lngTry = 1 To lngMax
varRtn = GetBit(2, 11)
Next lngTry
Debug.Print DebugTimerOff
Debug.Print "SET True: ";
DebugTimerOn
For lngTry = 1 To lngMax
varRtn = SetBit(2, 11, True)
Next lngTry
Debug.Print DebugTimerOff
Debug.Print "SET False: ";
DebugTimerOn
For lngTry = 1 To lngMax
varRtn = SetBit(2, 11, False)
Next lngTry
Debug.Print DebugTimerOff
Debug.Print "FLIP: ";
DebugTimerOn
For lngTry = 1 To lngMax
varRtn = FlipBit(2, 11)
Next lngTry
Debug.Print DebugTimerOff
Debug.Print "ASR, 11: ";
DebugTimerOn
For lngTry = 1 To lngMax
varRtn = ArithmeticShiftRight(2, 11)
Next lngTry
Debug.Print DebugTimerOff
Debug.Print "ASR, 8: ";
DebugTimerOn
For lngTry = 1 To lngMax
varRtn = ArithmeticShiftRight(2, 8)
Next lngTry
Debug.Print DebugTimerOff
Debug.Print "RL, 11: ";
DebugTimerOn
For lngTry = 1 To lngMax
varRtn = RotateLeft(2, 11)
Next lngTry
Debug.Print DebugTimerOff
Debug.Print "RL, 8: ";
DebugTimerOn
For lngTry = 1 To lngMax
varRtn = RotateLeft(2, 8)
Next lngTry
Debug.Print DebugTimerOff
Debug.Print "RR, 11: ";
DebugTimerOn
For lngTry = 1 To lngMax
varRtn = RotateRight(2, 11)
Next lngTry
Debug.Print DebugTimerOff
Debug.Print "RR, 8: ";
DebugTimerOn
For lngTry = 1 To lngMax
varRtn = RotateRight(2, 8)
Next lngTry
Debug.Print DebugTimerOff
Debug.Print "SL, 11: ";
DebugTimerOn
For lngTry = 1 To lngMax
varRtn = ShiftLeft(2, 11)
Next lngTry
Debug.Print DebugTimerOff
Debug.Print "SL, 8: ";
DebugTimerOn
For lngTry = 1 To lngMax
varRtn = ShiftLeft(2, 8)
Next lngTry
Debug.Print DebugTimerOff
Debug.Print "SR, 11: ";
DebugTimerOn
For lngTry = 1 To lngMax
varRtn = ShiftRight(2, 11)
Next lngTry
Debug.Print DebugTimerOff
Debug.Print "SR, 8: ";
DebugTimerOn
For lngTry = 1 To lngMax
varRtn = ShiftRight(2, 8)
Next lngTry
Debug.Print DebugTimerOff
End SubCopyright 1996-1999 Entisoft
Entisoft Tools is a trademark of Entisoft.