SlideShare a Scribd company logo
1 of 42
Download to read offline
Boost.Timer
日本語
Boost.Timer?
Boost.Chrono?
Boost.Chrono?
NO
Boost.Timer
boost::progress_display
Why?
How to Use
const int MAX = 100000;
progress_display show_progress(MAX);
for(int i=0; i<MAX; i++) {
DoSomething(i);
++show_progress;
}
const int MAX = 100000;
progress_display show_progress(MAX);
for(int i=0; i<MAX; i++) {
DoSomething(i);
++show_progress;
}
Beautiful Interface!
const int MAX =

0;

progress_display show_progress(MAX);
cout << show_progress.expected_count();
const int MAX =

0;

progress_display show_progress(MAX);
cout << show_progress.expected_count();

1
Interface
progress_display(
unsigned long expected_count,
std::ostream& os,
const std::string & s1 = "¥n",
const std::string & s2 = "",
const std::string & s3 = "");
progress_display(
unsigned long expected_count,
std::ostream& os,
const std::string & s1 = "¥n",
const std::string & s2 = "",
const std::string & s3 = "");
progress_display(
unsigned long expected_count,
std::ostream& os = std::cout,
const std::string & s1 = "¥n",
const std::string & s2 = "",
const std::string & s3 = "");
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?
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?
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?
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;
}
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;
}
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;
}
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;
}
void restart( unsigned long expected_count );
// Postconditions: count()==0
//

expected_count()==expected_count
void restart( unsigned long expected_count );
// Postconditions: count()==0
//

expected_count()==expected_count
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
unsigned long operator+=(unsigned long);
unsigned long operator++();
unsigned long count() const;
unsigned long expected_count() const;
Extra
const int MAX = 100000;
progress_display show_progress(MAX);
for(int i=0; i<MAX; i++) {
DoSomething(i);
++show_progress;
}
const int MAX = 100000;
progress_display show_progress(MAX);
for(int i=0; i<MAX+MAX; i++) {
DoSomething(i);
++show_progress;
}
const int MAX = 100000;
progress_display show_progress(MAX);
for(int i=0; i<MAX+MAX; i++) {
DoSomething(i);
++show_progress;
}
const int MAX = 100000;
progress_display show_progress(MAX);
for(int i=0; i<MAX+MAX; i++) {
DoSomething(i);
++show_progress;
}
const int MAX = 100000;
progress_display show_progress(MAX);
for(int i=0; i<MAX*MAX; i++) {
DoSomething(i);
++show_progress;
}
const int MAX = 100000;
progress_display show_progress(MAX);
for(int i=0; i<MAX*MAX; i++) {
DoSomething(i);
++show_progress;
}
Let's Enjoy
progress_display!
¥e

More Related Content

What's hot (20)

Include
IncludeInclude
Include
 
C questions
C questionsC questions
C questions
 
Solutionsfor co2 C Programs for data structures
Solutionsfor co2 C Programs for data structuresSolutionsfor co2 C Programs for data structures
Solutionsfor co2 C Programs for data structures
 
Ooprc3c
Ooprc3cOoprc3c
Ooprc3c
 
Ds
DsDs
Ds
 
A Shiny Example-- R
A Shiny Example-- RA Shiny Example-- R
A Shiny Example-- R
 
Data Structure in C Programming Language
Data Structure in C Programming LanguageData Structure in C Programming Language
Data Structure in C Programming Language
 
PROGRAM FOR INSERTION SORTING IN ARRAY
PROGRAM FOR INSERTION SORTING IN ARRAY PROGRAM FOR INSERTION SORTING IN ARRAY
PROGRAM FOR INSERTION SORTING IN ARRAY
 
C programs
C programsC programs
C programs
 
Program to sort the n names in an alphabetical order
Program to sort the n names in an alphabetical orderProgram to sort the n names in an alphabetical order
Program to sort the n names in an alphabetical order
 
Cpp c++ 2
Cpp c++ 2Cpp c++ 2
Cpp c++ 2
 
week-21x
week-21xweek-21x
week-21x
 
Implementing string
Implementing stringImplementing string
Implementing string
 
DAA Lab File C Programs
DAA Lab File C ProgramsDAA Lab File C Programs
DAA Lab File C Programs
 
Os lab file c programs
Os lab file c programsOs lab file c programs
Os lab file c programs
 
ADA FILE
ADA FILEADA FILE
ADA FILE
 
design and analysis of algorithm Lab files
design and analysis of algorithm Lab filesdesign and analysis of algorithm Lab files
design and analysis of algorithm Lab files
 
SaraPIC
SaraPICSaraPIC
SaraPIC
 
VTU Network lab programs
VTU Network lab   programsVTU Network lab   programs
VTU Network lab programs
 
Interview questions
Interview questionsInterview questions
Interview questions
 

Viewers also liked

C++14 solve explicit_default_constructor
C++14 solve explicit_default_constructorC++14 solve explicit_default_constructor
C++14 solve explicit_default_constructorAkira Takahashi
 
Introduction to boost test
Introduction to boost testIntroduction to boost test
Introduction to boost testKohsuke Yuasa
 
Pub/Sub model, msm, and asio
Pub/Sub model, msm, and asioPub/Sub model, msm, and asio
Pub/Sub model, msm, and asioTakatoshi Kondo
 
C++コミュニティーの中心でC++をDISる
C++コミュニティーの中心でC++をDISるC++コミュニティーの中心でC++をDISる
C++コミュニティーの中心でC++をDISるHideyuki Tanaka
 

Viewers also liked (7)

C++14 solve explicit_default_constructor
C++14 solve explicit_default_constructorC++14 solve explicit_default_constructor
C++14 solve explicit_default_constructor
 
Glfw3,OpenGL,GUI
Glfw3,OpenGL,GUI Glfw3,OpenGL,GUI
Glfw3,OpenGL,GUI
 
Introduction to boost test
Introduction to boost testIntroduction to boost test
Introduction to boost test
 
Pub/Sub model, msm, and asio
Pub/Sub model, msm, and asioPub/Sub model, msm, and asio
Pub/Sub model, msm, and asio
 
C++14 enum hash
C++14 enum hashC++14 enum hash
C++14 enum hash
 
Boost sg msgpack
Boost sg msgpackBoost sg msgpack
Boost sg msgpack
 
C++コミュニティーの中心でC++をDISる
C++コミュニティーの中心でC++をDISるC++コミュニティーの中心でC++をDISる
C++コミュニティーの中心でC++をDISる
 

Similar to Boost.Timer

How to build a html5 websites.v1
How to build a html5 websites.v1How to build a html5 websites.v1
How to build a html5 websites.v1Bitla Software
 
Rich and Snappy Apps (No Scaling Required)
Rich and Snappy Apps (No Scaling Required)Rich and Snappy Apps (No Scaling Required)
Rich and Snappy Apps (No Scaling Required)Thomas Fuchs
 
Look Ma, “update DB to HTML5 using C++”, no hands! 
Look Ma, “update DB to HTML5 using C++”, no hands! Look Ma, “update DB to HTML5 using C++”, no hands! 
Look Ma, “update DB to HTML5 using C++”, no hands! aleks-f
 
Cs pritical file
Cs pritical fileCs pritical file
Cs pritical fileMitul Patel
 
20110525[Taipei GTUG] titanium mobile簡介
20110525[Taipei GTUG] titanium mobile簡介20110525[Taipei GTUG] titanium mobile簡介
20110525[Taipei GTUG] titanium mobile簡介Justin Lee
 
C++ Programming - 1st Study
C++ Programming - 1st StudyC++ Programming - 1st Study
C++ Programming - 1st StudyChris Ohk
 
Алексей Кутумов, Coroutines everywhere
Алексей Кутумов, Coroutines everywhereАлексей Кутумов, Coroutines everywhere
Алексей Кутумов, Coroutines everywhereSergey Platonov
 
Embracing the-power-of-refactor
Embracing the-power-of-refactorEmbracing the-power-of-refactor
Embracing the-power-of-refactorXiaojun REN
 
Java.script
Java.scriptJava.script
Java.scriptg Nama
 

Similar to Boost.Timer (20)

JavaScript Refactoring
JavaScript RefactoringJavaScript Refactoring
JavaScript Refactoring
 
How to build a html5 websites.v1
How to build a html5 websites.v1How to build a html5 websites.v1
How to build a html5 websites.v1
 
Rich and Snappy Apps (No Scaling Required)
Rich and Snappy Apps (No Scaling Required)Rich and Snappy Apps (No Scaling Required)
Rich and Snappy Apps (No Scaling Required)
 
Look Ma, “update DB to HTML5 using C++”, no hands! 
Look Ma, “update DB to HTML5 using C++”, no hands! Look Ma, “update DB to HTML5 using C++”, no hands! 
Look Ma, “update DB to HTML5 using C++”, no hands! 
 
Cs pritical file
Cs pritical fileCs pritical file
Cs pritical file
 
Cpp programs
Cpp programsCpp programs
Cpp programs
 
20110525[Taipei GTUG] titanium mobile簡介
20110525[Taipei GTUG] titanium mobile簡介20110525[Taipei GTUG] titanium mobile簡介
20110525[Taipei GTUG] titanium mobile簡介
 
C++ Programming - 1st Study
C++ Programming - 1st StudyC++ Programming - 1st Study
C++ Programming - 1st Study
 
Алексей Кутумов, Coroutines everywhere
Алексей Кутумов, Coroutines everywhereАлексей Кутумов, Coroutines everywhere
Алексей Кутумов, Coroutines everywhere
 
Day 5
Day 5Day 5
Day 5
 
Managing console
Managing consoleManaging console
Managing console
 
Statistics.cpp
Statistics.cppStatistics.cpp
Statistics.cpp
 
CPP Homework Help
CPP Homework HelpCPP Homework Help
CPP Homework Help
 
TDD per Webapps
TDD per WebappsTDD per Webapps
TDD per Webapps
 
Pnno
PnnoPnno
Pnno
 
Railwaynew
RailwaynewRailwaynew
Railwaynew
 
Embracing the-power-of-refactor
Embracing the-power-of-refactorEmbracing the-power-of-refactor
Embracing the-power-of-refactor
 
C++ file
C++ fileC++ file
C++ file
 
Html
HtmlHtml
Html
 
Java.script
Java.scriptJava.script
Java.script
 

Recently uploaded

obat aborsi jakarta wa 081336238223 jual obat aborsi cytotec asli di jakarta9...
obat aborsi jakarta wa 081336238223 jual obat aborsi cytotec asli di jakarta9...obat aborsi jakarta wa 081336238223 jual obat aborsi cytotec asli di jakarta9...
obat aborsi jakarta wa 081336238223 jual obat aborsi cytotec asli di jakarta9...yulianti213969
 
Challenges and Opportunities: A Qualitative Study on Tax Compliance in Pakistan
Challenges and Opportunities: A Qualitative Study on Tax Compliance in PakistanChallenges and Opportunities: A Qualitative Study on Tax Compliance in Pakistan
Challenges and Opportunities: A Qualitative Study on Tax Compliance in Pakistanvineshkumarsajnani12
 
Beyond Numbers A Holistic Approach to Forensic Accounting
Beyond Numbers A Holistic Approach to Forensic AccountingBeyond Numbers A Holistic Approach to Forensic Accounting
Beyond Numbers A Holistic Approach to Forensic AccountingYourLegal Accounting
 
Presentation4 (2) survey responses clearly labelled
Presentation4 (2) survey responses clearly labelledPresentation4 (2) survey responses clearly labelled
Presentation4 (2) survey responses clearly labelledCaitlinCummins3
 
Goal Presentation_NEW EMPLOYEE_NETAPS FOUNDATION.pptx
Goal Presentation_NEW EMPLOYEE_NETAPS FOUNDATION.pptxGoal Presentation_NEW EMPLOYEE_NETAPS FOUNDATION.pptx
Goal Presentation_NEW EMPLOYEE_NETAPS FOUNDATION.pptxNetapsFoundationAdmi
 
10 Easiest Ways To Buy Verified TransferWise Accounts
10 Easiest Ways To Buy Verified TransferWise Accounts10 Easiest Ways To Buy Verified TransferWise Accounts
10 Easiest Ways To Buy Verified TransferWise Accountshttps://localsmmshop.com/
 
SCI9-Q4-MOD8.1.pdfjttstwjwetw55k5wwtwrjw
SCI9-Q4-MOD8.1.pdfjttstwjwetw55k5wwtwrjwSCI9-Q4-MOD8.1.pdfjttstwjwetw55k5wwtwrjw
SCI9-Q4-MOD8.1.pdfjttstwjwetw55k5wwtwrjwadimosmejiaslendon
 
Pitch Deck Teardown: Goodcarbon's $5.5m Seed deck
Pitch Deck Teardown: Goodcarbon's $5.5m Seed deckPitch Deck Teardown: Goodcarbon's $5.5m Seed deck
Pitch Deck Teardown: Goodcarbon's $5.5m Seed deckHajeJanKamps
 
Solar Panel Installation A Comprehensive Guide.pdf
Solar Panel Installation A Comprehensive Guide.pdfSolar Panel Installation A Comprehensive Guide.pdf
Solar Panel Installation A Comprehensive Guide.pdfDYFA Electrical
 
SCI9-Q4-MOD9.pdfetiwtitw3i3uu45w5wtitwjt
SCI9-Q4-MOD9.pdfetiwtitw3i3uu45w5wtitwjtSCI9-Q4-MOD9.pdfetiwtitw3i3uu45w5wtitwjt
SCI9-Q4-MOD9.pdfetiwtitw3i3uu45w5wtitwjtadimosmejiaslendon
 
Pixar Case Analysis.....................
Pixar Case Analysis.....................Pixar Case Analysis.....................
Pixar Case Analysis.....................mikelopezalv
 
Progress Report - Oracle's OCI Analyst Summit 2024
Progress Report - Oracle's OCI Analyst Summit 2024Progress Report - Oracle's OCI Analyst Summit 2024
Progress Report - Oracle's OCI Analyst Summit 2024Holger Mueller
 
A DAY IN THE LIFE OF A SALESPERSON .pptx
A DAY IN THE LIFE OF A SALESPERSON .pptxA DAY IN THE LIFE OF A SALESPERSON .pptx
A DAY IN THE LIFE OF A SALESPERSON .pptxseemajojo02
 

Recently uploaded (20)

Obat Aborsi Malang 0851\7696\3835 Jual Obat Cytotec Di Malang
Obat Aborsi Malang 0851\7696\3835 Jual Obat Cytotec Di MalangObat Aborsi Malang 0851\7696\3835 Jual Obat Cytotec Di Malang
Obat Aborsi Malang 0851\7696\3835 Jual Obat Cytotec Di Malang
 
Obat Aborsi Surabaya 0851\7696\3835 Jual Obat Cytotec Di Surabaya
Obat Aborsi Surabaya 0851\7696\3835 Jual Obat Cytotec Di SurabayaObat Aborsi Surabaya 0851\7696\3835 Jual Obat Cytotec Di Surabaya
Obat Aborsi Surabaya 0851\7696\3835 Jual Obat Cytotec Di Surabaya
 
obat aborsi jakarta wa 081336238223 jual obat aborsi cytotec asli di jakarta9...
obat aborsi jakarta wa 081336238223 jual obat aborsi cytotec asli di jakarta9...obat aborsi jakarta wa 081336238223 jual obat aborsi cytotec asli di jakarta9...
obat aborsi jakarta wa 081336238223 jual obat aborsi cytotec asli di jakarta9...
 
Challenges and Opportunities: A Qualitative Study on Tax Compliance in Pakistan
Challenges and Opportunities: A Qualitative Study on Tax Compliance in PakistanChallenges and Opportunities: A Qualitative Study on Tax Compliance in Pakistan
Challenges and Opportunities: A Qualitative Study on Tax Compliance in Pakistan
 
Beyond Numbers A Holistic Approach to Forensic Accounting
Beyond Numbers A Holistic Approach to Forensic AccountingBeyond Numbers A Holistic Approach to Forensic Accounting
Beyond Numbers A Holistic Approach to Forensic Accounting
 
Presentation4 (2) survey responses clearly labelled
Presentation4 (2) survey responses clearly labelledPresentation4 (2) survey responses clearly labelled
Presentation4 (2) survey responses clearly labelled
 
Goal Presentation_NEW EMPLOYEE_NETAPS FOUNDATION.pptx
Goal Presentation_NEW EMPLOYEE_NETAPS FOUNDATION.pptxGoal Presentation_NEW EMPLOYEE_NETAPS FOUNDATION.pptx
Goal Presentation_NEW EMPLOYEE_NETAPS FOUNDATION.pptx
 
10 Easiest Ways To Buy Verified TransferWise Accounts
10 Easiest Ways To Buy Verified TransferWise Accounts10 Easiest Ways To Buy Verified TransferWise Accounts
10 Easiest Ways To Buy Verified TransferWise Accounts
 
Obat Aborsi Depok 0851\7696\3835 Jual Obat Cytotec Di Depok
Obat Aborsi Depok 0851\7696\3835 Jual Obat Cytotec Di DepokObat Aborsi Depok 0851\7696\3835 Jual Obat Cytotec Di Depok
Obat Aborsi Depok 0851\7696\3835 Jual Obat Cytotec Di Depok
 
Obat Aborsi Jakarta 0851\7696\3835 Jual Obat Cytotec Di Jakarta
Obat Aborsi Jakarta 0851\7696\3835 Jual Obat Cytotec Di JakartaObat Aborsi Jakarta 0851\7696\3835 Jual Obat Cytotec Di Jakarta
Obat Aborsi Jakarta 0851\7696\3835 Jual Obat Cytotec Di Jakarta
 
WAM Corporate Presentation May 2024_w.pdf
WAM Corporate Presentation May 2024_w.pdfWAM Corporate Presentation May 2024_w.pdf
WAM Corporate Presentation May 2024_w.pdf
 
SCI9-Q4-MOD8.1.pdfjttstwjwetw55k5wwtwrjw
SCI9-Q4-MOD8.1.pdfjttstwjwetw55k5wwtwrjwSCI9-Q4-MOD8.1.pdfjttstwjwetw55k5wwtwrjw
SCI9-Q4-MOD8.1.pdfjttstwjwetw55k5wwtwrjw
 
Pitch Deck Teardown: Goodcarbon's $5.5m Seed deck
Pitch Deck Teardown: Goodcarbon's $5.5m Seed deckPitch Deck Teardown: Goodcarbon's $5.5m Seed deck
Pitch Deck Teardown: Goodcarbon's $5.5m Seed deck
 
Solar Panel Installation A Comprehensive Guide.pdf
Solar Panel Installation A Comprehensive Guide.pdfSolar Panel Installation A Comprehensive Guide.pdf
Solar Panel Installation A Comprehensive Guide.pdf
 
SCI9-Q4-MOD9.pdfetiwtitw3i3uu45w5wtitwjt
SCI9-Q4-MOD9.pdfetiwtitw3i3uu45w5wtitwjtSCI9-Q4-MOD9.pdfetiwtitw3i3uu45w5wtitwjt
SCI9-Q4-MOD9.pdfetiwtitw3i3uu45w5wtitwjt
 
Pixar Case Analysis.....................
Pixar Case Analysis.....................Pixar Case Analysis.....................
Pixar Case Analysis.....................
 
Progress Report - Oracle's OCI Analyst Summit 2024
Progress Report - Oracle's OCI Analyst Summit 2024Progress Report - Oracle's OCI Analyst Summit 2024
Progress Report - Oracle's OCI Analyst Summit 2024
 
Home Furnishings Ecommerce Platform Short Pitch 2024
Home Furnishings Ecommerce Platform Short Pitch 2024Home Furnishings Ecommerce Platform Short Pitch 2024
Home Furnishings Ecommerce Platform Short Pitch 2024
 
Obat Aborsi Pasuruan 0851\7696\3835 Jual Obat Cytotec Di Pasuruan
Obat Aborsi Pasuruan 0851\7696\3835 Jual Obat Cytotec Di PasuruanObat Aborsi Pasuruan 0851\7696\3835 Jual Obat Cytotec Di Pasuruan
Obat Aborsi Pasuruan 0851\7696\3835 Jual Obat Cytotec Di Pasuruan
 
A DAY IN THE LIFE OF A SALESPERSON .pptx
A DAY IN THE LIFE OF A SALESPERSON .pptxA DAY IN THE LIFE OF A SALESPERSON .pptx
A DAY IN THE LIFE OF A SALESPERSON .pptx
 

Boost.Timer