Skip to content

Instantly share code, notes, and snippets.

Last active September 10, 2019 13:43
What would you like to do?
C++ timers
// adapted from
#include <chrono>
#include <iostream>
using Clock = std::chrono::high_resolution_clock;
auto t1 = Clock::now();
// do stuff
auto t2 = Clock::now();
std::cout << std::chrono::duration_cast<std::chrono::milliseconds>(t2-t1).count() << "ms" << std::endl;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment