0
I need to compute the execution time of sorting algorithms. I did the following:
steady_clock::time_point t3 = steady_clock::now();
quickSort(v, 0, n - 1);
steady_clock::time_point t4 = steady_clock::now();
duration<double> time_span = duration_cast<duration<double,nano>>(t4 - t3);
The problem is that for time I cannot compute times less than 0.001 seconds, the value of time_span
appears equal to 0.
trade in
steady_clock
forhigh_resolution_clock
solves something? I find it unlikely, but possible.– Marcos Banik