I am running a .cpp code (i) in sequential style and (ii) using OpenMP statements. I am trying to see the time difference. For calculating time, I use this:
I've seen clock() reporting CPU time, instead of real time.
You could use
struct timeval start, end; gettimeofday(&start, NULL); // benchmark code gettimeofday(&end, NULL); delta = ((end.tv_sec - start.tv_sec) * 1000000u + end.tv_usec - start.tv_usec) / 1.e6;
To time things instead