Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- #include <chrono>
- int main()
- {
- using namespace std::chrono;
- steady_clock::time_point t1 = steady_clock::now();
- for(int i = 0; i < 1000000000; i++)
- {
- std::string a("");
- }
- steady_clock::time_point t2 = steady_clock::now();
- duration<double> time_span = duration_cast<duration<double>>(t2 - t1);
- std::cout << "The operations took " << time_span.count() << " seconds." << std::endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement