Boost.Timer

2,817 views

Published on

Published in: Business, Technology
1 Comment
2 Likes
Statistics
Notes
  • What is this?
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
No Downloads
Views
Total views
2,817
On SlideShare
0
From Embeds
0
Number of Embeds
760
Actions
Shares
0
Downloads
19
Comments
1
Likes
2
Embeds 0
No embeds

No notes for slide

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

×