i have two integer array, each size 95700.i want compare to two integer arrays,i got maximum size of integer using Integer.MAX_VALUE(2147483647).
i used following code,
for(int i=0;i<array1.length;i++) {
if (array1[i] == 0xFF0000FF && array2[i] == 0xFFFFFFFF) {
matched++;
} else {
unMatched++;
}
}
this code taking lot of time(50s). How to decreases comparison time…please help me
EDIT:
this is my logcat:
12-22 15:20:29.638: INFO/System.out(1660): start time-----18041173568804
12-22 15:20:29.638: INFO/System.out(1660): time-----40981116222
12-22 15:20:29.688: INFO/System.out(1660): The array comparison toook an average of 40.981116 second
You need to provide more detail because there is no way the array comparison is taking 50 seconds, or even 50 milli-seconds as described
prints
That is one tenth of one milli-second.