Created
July 16, 2016 14:07
-
-
Save yangacer/216974b62294f49b69696a78f72210b9 to your computer and use it in GitHub Desktop.
Mini C++ profiler (support multicore)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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