If you want to do benchmarking, instead of using std::clock_t you should consider using time_point<high_resolution_clock>
using std::chrono
:
using namespace std::chrono;
high_resolution_clock::time_point t = high_resolution_clock::now();
//... do what is to be measured
high_resolution_clock::time_point t2 = high_resolution_clock::now();
cout << duration_cast<milliseconds>(t2 - t).count();
However, timing is always an imprecise measure that depends on the clock resolution (on windows for example, the resolution is around 15 ms). So the shorter the time you measure, the higher is the relative error in the measure. So if your function takes 15 ms to execute, on windows, you'll have an error in the measure of +/- 100%.
The only way you can increase reliability of the measure, is to measure a longer time, by having a huge number of iterations. So in the example, with 1 million iterations, the relative error of the measure is 0,0001%.
If you can benchmark your functions separately, just do it like that. But if you can't measure your functions separately (for example because one produces the input for the other), you can't use this approach). If you want to find the bottleneck your code in such case, then you should use the right tool: a profiler.