Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <chrono>
- #define TIME_ELAPSED(code) auto start = std::chrono::high_resolution_clock::now(); code auto end = std::chrono::high_resolution_clock::now(); std::cout << "Time elapsed : " << static_cast<double>(std::chrono::duration_cast<std::chrono::nanoseconds>(end - start).count()) / 1000000000.0 << "s";
- int main()
- {
- TIME_ELAPSED(
- for (auto index = 0; index < 100000; ++index)
- std::cout << "Bla bla bla";
- )
- return 0;
- }
Add Comment
Please, Sign In to add comment