Created
April 22, 2019 04:50
-
-
Save srz-zumix/6ace2c2214ae72bc99d92913e6485f03 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // https://wandbox.org/permlink/DnmwABiHeYne8Iaz | |
| #include <iostream> | |
| #include <cstdlib> | |
| #include <boost/timer/timer.hpp> | |
| int main() | |
| { | |
| const long n=10000000; | |
| { | |
| boost::timer::cpu_timer timer; | |
| for (long i = 0; i < n; ++i) { | |
| // DO 1 | |
| } | |
| std::string result = timer.format(); | |
| std::cout << result << std::endl; | |
| } | |
| { | |
| boost::timer::cpu_timer timer; | |
| for (long i = 0; i < n; ++i) { | |
| // DO 2 | |
| } | |
| std::string result = timer.format(); | |
| std::cout << result << std::endl; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment