Created
January 15, 2014 17:20
-
-
Save PoisonousJohn/8440389 to your computer and use it in GitHub Desktop.
snippet for time profiling
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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