measure time taken by code in c++
#include <chrono>
using namespace std::chrono;
// Use auto keyword to avoid typing long
// type definitions to get the timepoint
// at this instant use function now()
auto start = high_resolution_clock::now();
// After function call
auto stop = high_resolution_clock::now();
auto duration = duration_cast<microseconds>(stop - start);
// To get the value of duration use the count()
// member function on the duration object
cout << duration.count() << endl;