Created
November 12, 2015 14:38
-
-
Save SergiusTheBest/1ce2dce0f9fdd24351dd to your computer and use it in GitHub Desktop.
Use of std clock to calculate a time span
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
auto start = std::chrono::high_resolution_clock::now(); | |
::Sleep(1000); | |
auto end = std::chrono::high_resolution_clock::now(); | |
auto duration = std::chrono::duration_cast<std::chrono::duration<double, std::mili>>(end - start); | |
std::cout << duration.count(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment