Skip to content

Instantly share code, notes, and snippets.

@akbiggs
Created April 17, 2020 17:12
Show Gist options
  • Save akbiggs/4bf2962d368f74c224dc8d5f5c628821 to your computer and use it in GitHub Desktop.
Save akbiggs/4bf2962d368f74c224dc8d5f5c628821 to your computer and use it in GitHub Desktop.
std::chrono::time_point<std::chrono::high_resolution_clock> p1;
std::chrono::time_point<std::chrono::high_resolution_clock> p2;
std::string tag;
#define START_PROFILE(t) tag = t; cout << "start " << tag << std::endl; p1 = std::chrono::high_resolution_clock::now();
#define END_PROFILE() p2 = std::chrono::high_resolution_clock::now(); cout << "end " << tag << " " << std::chrono::duration<double, std::milli>(p2 - p1).count() << std::endl;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment