Answers for "how to check code execution time in visual studio c++"

C++
0

how to check code execution time in visual studio c++

#include<bits/stdc++.h>
using namespace std;
using namespace std::chrono;
int main(){
auto start = high_resolution_clock::now();
  .....
	......
//time function
cout << "\n";
auto stop = high_resolution_clock::now();
auto duration = duration_cast<microseconds>(stop - start);
cout << "Time taken by function: " << duration.count() << " microseconds" << "\n";

  
  
  return 0;
}
Posted by: Guest on April-20-2022

Code answers related to "how to check code execution time in visual studio c++"

Browse Popular Code Answers by Language