MaximCherchuk

C time

May 10th, 2015
227
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.47 KB | None | 0 0
  1. #include <iostream>
  2. #include <ctime>
  3. #include <ratio>
  4. #include <chrono>
  5.  
  6. using namespace std;
  7. using namespace chrono;
  8.  
  9.  
  10. int main () {
  11.     high_resolution_clock::time_point t1 = high_resolution_clock::now();
  12.  
  13.     // прога
  14.    
  15.     high_resolution_clock::time_point t2 = high_resolution_clock::now();
  16.     duration<double> time_span = duration_cast< duration<double> >(t2 - t1);
  17.     cout << endl << "It took me " << time_span.count() << " seconds" << endl;
  18. }
Advertisement
Add Comment
Please, Sign In to add comment