Skip to content

Instantly share code, notes, and snippets.

@esmitt
Last active April 6, 2021 08:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save esmitt/0b21d6b61e1f8341843cf9803444fd5e to your computer and use it in GitHub Desktop.
Save esmitt/0b21d6b61e1f8341843cf9803444fd5e to your computer and use it in GitHub Desktop.
#include <iostream>
#include <chrono>
int main()
{
std::cout << "Starting computation ..." << std::endl;
auto start = std::chrono::steady_clock::now();
// insert code to measure here
auto end = std::chrono::steady_clock::now();
auto diff = end - start;
std::cout << "Time: " << std::chrono::duration <double, std::milli>(diff).count() << " ms" << std::endl;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment