Skip to content

Instantly share code, notes, and snippets.

@yangacer
Created July 16, 2016 14:07
Show Gist options
  • Save yangacer/216974b62294f49b69696a78f72210b9 to your computer and use it in GitHub Desktop.
Save yangacer/216974b62294f49b69696a78f72210b9 to your computer and use it in GitHub Desktop.
Mini C++ profiler (support multicore)
struct profiler {
profiler() : m_start{chrono::high_resolution_clock::now()} {
}
size_t til_now() const {
return chrono::duration_cast<chrono::milliseconds>(
chrono::high_resolution_clock::now() - m_start).count();
}
chrono::high_resolution_clock::time_point m_start;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment