Skip to content

Instantly share code, notes, and snippets.

@PoisonousJohn
Created January 15, 2014 17:20
Show Gist options
  • Save PoisonousJohn/8440389 to your computer and use it in GitHub Desktop.
Save PoisonousJohn/8440389 to your computer and use it in GitHub Desktop.
snippet for time profiling
#include <iostream>
#include <chrono>
int main()
{
auto t1 = std::chrono::high_resolution_clock::now(); //Used in testing execution duration.
auto t2 = std::chrono::high_resolution_clock::now();
std::cout << "test function took "
<< std::chrono::duration_cast<std::chrono::nanoseconds>(t2 - t1).count()
<< " nanoseconds\n";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment