Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Boost.Timer

  • Login to see the comments

Boost.Timer

  1. 1. Boost.Timer 日本語
  2. 2. Boost.Timer?
  3. 3. Boost.Chrono?
  4. 4. Boost.Chrono? NO
  5. 5. Boost.Timer
  6. 6. boost::progress_display
  7. 7. Why?
  8. 8. How to Use
  9. 9. const int MAX = 100000; progress_display show_progress(MAX); for(int i=0; i<MAX; i++) { DoSomething(i); ++show_progress; }
  10. 10. const int MAX = 100000; progress_display show_progress(MAX); for(int i=0; i<MAX; i++) { DoSomething(i); ++show_progress; }
  11. 11. Beautiful Interface!
  12. 12. const int MAX = 0; progress_display show_progress(MAX); cout << show_progress.expected_count();
  13. 13. const int MAX = 0; progress_display show_progress(MAX); cout << show_progress.expected_count(); 1
  14. 14. Interface
  15. 15. progress_display( unsigned long expected_count, std::ostream& os, const std::string & s1 = "¥n", const std::string & s2 = "", const std::string & s3 = "");
  16. 16. progress_display( unsigned long expected_count, std::ostream& os, const std::string & s1 = "¥n", const std::string & s2 = "", const std::string & s3 = "");
  17. 17. progress_display( unsigned long expected_count, std::ostream& os = std::cout, const std::string & s1 = "¥n", const std::string & s2 = "", const std::string & s3 = "");
  18. 18. progress_display( unsigned long expected_count, std::ostream& os = std::cout, const std::string & s1 = "¥n", const std::string & s2 = "", const std::string & s3 = ""); Customize?
  19. 19. progress_display( unsigned long expected_count, std::ostream& os = std::cout, const std::string & s1 = "¥n", const std::string & s2 = "", const std::string & s3 = ""); Customize?
  20. 20. progress_display( unsigned long expected_count, std::ostream& os = std::cout, const std::string & s1 = "¥n", const std::string & s2 = "", const std::string & s3 = ""); Customize?
  21. 21. const int MAX = 100000; progress_display show_progress(MAX, std::cout, "hoge", "fuga", "hagebs"); for(int i=0; i<MAX; i++) { DoSomething(i); ++show_progress; }
  22. 22. const int MAX = 100000; progress_display show_progress(MAX, std::cout, "hoge", "fuga", "hagebs"); for(int i=0; i<MAX; i++) { DoSomething(i); ++show_progress; }
  23. 23. const int MAX = 100000; progress_display show_progress(MAX, std::cout, "hoge", "fuga", "hagebs"); for(int i=0; i<MAX; i++) { DoSomething(i); ++show_progress; }
  24. 24. const int MAX = 100000; progress_display show_progress(MAX, std::cout, "hoge", "fuga", "hagebs"); for(int i=0; i<MAX; i++) { DoSomething(i); ++show_progress; }
  25. 25. void restart( unsigned long expected_count ); // Postconditions: count()==0 // expected_count()==expected_count
  26. 26. void restart( unsigned long expected_count ); // Postconditions: count()==0 // expected_count()==expected_count
  27. 27. void restart( unsigned long expected_count ); // Postconditions: count()==0 // expected_count()==expected_count const int MAX = 0; progress_display show_progress(MAX); cout << show_progress.expected_count(); 1
  28. 28. unsigned long operator+=(unsigned long); unsigned long operator++(); unsigned long count() const; unsigned long expected_count() const;
  29. 29. Extra
  30. 30. const int MAX = 100000; progress_display show_progress(MAX); for(int i=0; i<MAX; i++) { DoSomething(i); ++show_progress; }
  31. 31. const int MAX = 100000; progress_display show_progress(MAX); for(int i=0; i<MAX+MAX; i++) { DoSomething(i); ++show_progress; }
  32. 32. const int MAX = 100000; progress_display show_progress(MAX); for(int i=0; i<MAX+MAX; i++) { DoSomething(i); ++show_progress; }
  33. 33. const int MAX = 100000; progress_display show_progress(MAX); for(int i=0; i<MAX+MAX; i++) { DoSomething(i); ++show_progress; }
  34. 34. const int MAX = 100000; progress_display show_progress(MAX); for(int i=0; i<MAX*MAX; i++) { DoSomething(i); ++show_progress; }
  35. 35. const int MAX = 100000; progress_display show_progress(MAX); for(int i=0; i<MAX*MAX; i++) { DoSomething(i); ++show_progress; }
  36. 36. Let's Enjoy progress_display!
  37. 37. ¥e

×