Skip to content

Instantly share code, notes, and snippets.

@SergiusTheBest
Created November 12, 2015 14:38
Show Gist options
  • Save SergiusTheBest/1ce2dce0f9fdd24351dd to your computer and use it in GitHub Desktop.
Save SergiusTheBest/1ce2dce0f9fdd24351dd to your computer and use it in GitHub Desktop.
Use of std clock to calculate a time span
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