Is that working for you? #include <Array.au3>
Global $array1[100000], $array2[111111], $i, $t, $fProgress
ConsoleWrite("Creating test array... ")
$t = TimerInit()
For $i = 0 To UBound($array1) - 1
$array1[$i] = Random(0, 100000, 1)
$array2[$i] = Random(0, 111111, 1)
Next
ConsoleWrite("done in " & Round(TimerDiff($t), 2) & " ms." & @CRLF)
Global $aResult = ArrayCompare($array1, $array2)
ConsoleWrite(UBound($aResult) & @CRLF)
;~ _ArrayDisplay($aResult)
Func ArrayCompare(ByRef $a1, $a2)
ConsoleWrite("Sorting 2nd array... ")
Local $t = TimerInit()
_ArraySort($a2)
ConsoleWrite("done in " & Round(TimerDiff($t), 2) & " ms." & @CRLF)
Local $i, $c = 0, $iUB = UBound($a1) > UBound($a2) ? UBound($a1) : UBound($a2), $aNew[$iUB], $iUB = UBound($a1) - 1
ConsoleWrite("Searching " & $iUB & " elements in " & UBound($a2) - 1 & " elements ... ")
AdlibRegister("Show_Progress", 500)
$fProgress = 0
ProgressOn("Progress Meter", "Be patient, searching for duplicates...", "0%")
$t = TimerInit()
For $i = 0 To $iUB
If _ArrayBinarySearch($a2, String($a1[$i])) > -1 Then
ContinueLoop
Else
$aNew[$c] = $a1[$i]
$c += 1
EndIf
$fProgress = $i / $iUB * 100
Next
ReDim $aNew[$c]
ConsoleWrite("done in " & Round(TimerDiff($t), 2) & " ms." & @CRLF & @CRLF)
AdlibUnRegister("Show_Progress")
ProgressOff()
Return $aNew
EndFunc
Func Show_Progress()
ProgressSet($fProgress, StringFormat("%.2f %", $fProgress))
EndFunc
Br, UEZ