Skip to content

Instantly share code, notes, and snippets.

@anirul
Created May 20, 2015 15:23
Show Gist options
  • Save anirul/2b7060f377203340a3a4 to your computer and use it in GitHub Desktop.
Save anirul/2b7060f377203340a3a4 to your computer and use it in GitHub Desktop.
Count time of action (using chrono)
#include <chrono>
#include <iostream>
int main(int ac, char** av) {
auto start = std::chrono::system_clock::now();
// action
auto end = std::chrono::system_clock::now();
std::chrono::duration<double> total = end - start;
std::cout << "time : " << total.count();
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment