Example code 1:
const int N=100000;
for(int j=0;j<N;j++){
arr1[j] += a1[j];
arr2[j] += a2[j];
}
Example code 2:
for(int j=0;j<N;j++){
arr1[j] += a1[j];
}
for(int j=0;j<N;j++){
arr2[j] += a2[j];
}
I need to calculate the running time of these block of code. Is there any tool(benchmark) to calculate it?
1 Answer