This second part of the code is inefficient and incorrect because it adds more values than the source code.
Scrolling the loop (or decreasing in this case, since you probably do not want to expand the loop of ten thousand iterations), will be:
for (int i = 0; i < N_TIMES; i++)
for (int j = 0; j < ARRAY_SIZE; j += 2)
sum += array[j] + array[j+1];
, , . - , , , .
. , , , :
int temp = 0;
for (int i = 0; i < ARRAY_SIZE; i++)
temp += array[i];
sum += temp * N_TIMES;
O(n), n (, ). , gcc -O3 , . .
, : -)