c++ measure time

#include <iostream>
#include <chrono>

int main() {
    // Record the start time point
    auto start_time = std::chrono::high_resolution_clock::now();

    // Code to measure the time for

    // Record the end time point
    auto end_time = std::chrono::high_resolution_clock::now();

    // Calculate the duration between start and end time points
    auto duration = std::chrono::duration_cast<std::chrono::microseconds>(end_time - start_time);

    // Print the duration in microseconds
    std::cout << "Time taken by code: " << duration.count() << " microseconds" << std::endl;

    return 0;
}