Created
November 6, 2014 19:26
-
-
Save gchudnov/5d88cd3a393c9f4b4210 to your computer and use it in GitHub Desktop.
Measure elapsed time
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 <iostream> | |
#include <chrono> | |
int main() { | |
auto t0(std::chrono::steady_clock::now()); | |
// some code to measure time for | |
auto t1(std::chrono::steady_clock::now()); | |
auto duration = std::chrono::duration_cast<std::chrono::milliseconds>(t1 - t0); | |
std::cout << duration.count() << std::endl; | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment