Created
November 10, 2020 09:35
-
-
Save SCG82/3a4c4ae210312c33cb318a33de0d0c3c to your computer and use it in GitHub Desktop.
Measure execution time of code block in C++
This file contains 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
#include <chrono> | |
auto t1 = std::chrono::high_resolution_clock::now(); | |
// code to measure | |
auto t2 = std::chrono::high_resolution_clock::now(); | |
auto dur = t2 - t1; | |
cout << dur.count() / rtc::kNumNanosecsPerMicrosec; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment