Advertisement
Guest User

Untitled

a guest
Mar 26th, 2019
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. #include <iostream>
  2. #include <boost/version.hpp>
  3. #include <boost/config.hpp>
  4. #include <boost/timer.hpp>
  5. #include <boost/progress.hpp>
  6. #include <ctime>
  7.  
  8. using namespace std;
  9.  
  10. int main()
  11. {
  12. // boost::progress_timer tt;
  13. boost::timer t;
  14. clock_t t1 = clock(); // cpu clock not wall time
  15.  
  16.  
  17. boost::progress_display pd(10000000000);
  18.  
  19. for(int i = 0; i < 100000; i++)
  20. for(int j = 0; j < 100000; j++)
  21. {
  22. int x = 1;
  23. ++pd;
  24. }
  25. clock_t t2 = clock();
  26.  
  27. std::cout << t.elapsed() << " s" << std::endl;
  28. std::cout << double(t2 - t1) / CLOCKS_PER_SEC << " s" << std::endl;
  29. return 0;
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement