Hello , I can't figure how to properly measure time execution when I have 2 loops and I want to measure the time for the innermost loop:
for (int i = 1; i <= N; i++) {
.....
clock_t begin = clock();
for (int j =1; j<= M; j++){ //want to measure time for this loop for each "i"
...
}
clock_t end = clock();
}
Like this it only measures correct time for the first loop.