Part of my program is something like this:
//encoding timer starts
enc_start = clock();
//encoding timer stops
enc_finish = clock();
duration += (double)(enc_finish - enc_start);
//At the end of the program, i print out the total timing
duration /= CLOCKS_PER_SEC;
printf("\nEncoding time = %2.3f secs", duration);
The problem is that I'm getting different timing everytime I run the program. And the difference can be relatively big.
Is there any way to get consistent timing? or other method other than averaging the timing?