Skip to content

Instantly share code, notes, and snippets.

@Felipeasg
Forked from deysumitkr/ExecutionTime_AlmostGeneric.cpp
Created January 21, 2019 22:33
Show Gist options
  • Save Felipeasg/b45c4368fb9e134683aa3275ba6fd667 to your computer and use it in GitHub Desktop.
Save Felipeasg/b45c4368fb9e134683aa3275ba6fd667 to your computer and use it in GitHub Desktop.
Execution time of a code snippet
#include <chrono>
auto start = std::chrono::high_resolution_clock::now();
// Code to time
auto finish = std::chrono::high_resolution_clock::now();
double duration = std::chrono::duration_cast<std::chrono::milliseconds>(finish - start).count();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment