Created
April 24, 2016 09:30
-
-
Save addam/9296ae048eacd6cf64c8b76f34c7f276 to your computer and use it in GitHub Desktop.
two-liner for measuring elapsed time in C++11
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> | |
std::chrono::high_resolution_clock::time_point t_start = std::chrono::high_resolution_clock::now(); | |
//... | |
float elapsedTime = std::chrono::duration_cast<std::chrono::duration<float>>(std::chrono::high_resolution_clock::now() - t_start).count(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment