how to measure program run time in c++

C++
#include <chrono> 

auto start = chrono::high_resolution_clock::now(); 

// CODE

auto stop = chrono::high_resolution_clock::now();
auto duration = duration_cast<microseconds>(stop - start);
cout << duration.count() << endl; 

Source

Also in C++: