#include <chrono>
auto start = std::chrono::steady_clock::now();
//
// Insert the code that will be timed
//
auto end = std::chrono::steady_clock::now();
std::cout << "Time difference = " << std::chrono::duration_cast<std::chrono::microseconds>(end - start).count() << " µs" << std::endl;
std::cout << "Time difference = " << std::chrono::duration_cast<std::chrono::nanoseconds> (end - start).count() << " ns" << std::endl;
Last active
August 19, 2020 08:44
-
-
Save sy6sy2/46bbce356c953b5203ff426a330dfca6 to your computer and use it in GitHub Desktop.
[C++ snippets] #CPP
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment