Skip to content

Instantly share code, notes, and snippets.

@cutebomb
Created January 18, 2023 14:16
Show Gist options
  • Save cutebomb/68823feeb900c908254dd54df63a8adf to your computer and use it in GitHub Desktop.
Save cutebomb/68823feeb900c908254dd54df63a8adf to your computer and use it in GitHub Desktop.
c++ run time code
#include <chrono>
using namespace std::chrono;
auto start = high_resolution_clock::now();
// some code here
auto stop = high_resolution_clock::now();
auto duration = duration_cast<milliseconds>(stop - start);
cout << duration.count() << "ms" << endl;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment