Advertisement
Guest User

Untitled

a guest
Sep 12th, 2013
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.46 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. #include <chrono>
  4.  
  5. int main()
  6. {
  7.     using namespace std::chrono;
  8.    
  9.     steady_clock::time_point t1 = steady_clock::now();
  10.    
  11.     for(int i = 0; i < 1000000000; i++)
  12.     {
  13.         std::string a("");
  14.     }
  15.    
  16.     steady_clock::time_point t2 = steady_clock::now();
  17.     duration<double> time_span = duration_cast<duration<double>>(t2 - t1);
  18.     std::cout << "The operations took " << time_span.count() << " seconds." << std::endl;
  19.    
  20.     return 0;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement