Private Sub XorValuesBenchmark() ' Benchmark of the XorValues function. 'See also: ' BitwiseBenchmark Subroutine Const FACTOR = 32 Const MinStrLen = 1 Const MaxStrLen = 64 Dim lngMax As Long Dim lngTry As Long Dim varRtn As Variant lngMax = 10240 Debug.Print "Count = " & lngMax Dim astrData() As String ReDim astrData(0 To 2, 0 To lngMax \ FACTOR) Debug.Print "Generate " & lngMax \ FACTOR & " test cases: "; DebugTimerOn For lngTry = 1 To lngMax \ FACTOR astrData(1, lngTry) = RandomString(MinStrLen, MaxStrLen, Null) astrData(2, lngTry) = RandomString(MinStrLen, MaxStrLen, Null) Next lngTry Debug.Print DebugTimerOff Debug.Print "XOR S: "; DebugTimerOn For lngTry = 1 To lngMax varRtn = XorValues(astrData(1, lngTry \ FACTOR), astrData(2, lngTry \ FACTOR)) Next lngTry Debug.Print DebugTimerOff Debug.Print "XOR I: "; DebugTimerOn For lngTry = 1 To lngMax varRtn = XorValues(2, 3) Next lngTry Debug.Print DebugTimerOff Debug.Print "XOR L: "; DebugTimerOn For lngTry = 1 To lngMax varRtn = XorValues(2&, 3&) Next lngTry Debug.Print DebugTimerOff End Sub
Copyright 1996-1999 Entisoft
Entisoft Tools is a trademark of Entisoft.