c++ boost--------------boost::progress_timer小试。
2016-04-28 16:12
513 查看
1 //--------------------------------------------------------------------------- 2 3 #include <vcl.h> 4 #pragma hdrstop 5 6 #include "Unit4.h" 7 #include <boost/progress.hpp> 8 #include <sstream> 9 using namespace std; 10 //--------------------------------------------------------------------------- 11 #pragma package(smart_init) 12 #pragma resource "*.dfm" 13 TForm4 *Form4; 14 //--------------------------------------------------------------------------- 15 __fastcall TForm4::TForm4(TComponent* Owner) 16 : TForm(Owner) 17 { 18 } 19 20 void test_timer(std::stringstream& ss) 21 { 22 ss.clear(); 23 boost::progress_timer t(ss); 24 25 { 26 //boost::progress_timer t1(ss); 27 Sleep(1000); 28 //Form4->Memo1->Lines->Add((AnsiString)"1--"+ss.str().c_str()); 29 } 30 31 { 32 //boost::progress_timer t2(ss); 33 //boost::progress_timer t(ss); 34 Sleep(2001); 35 //Form4->Memo1->Lines->Add((AnsiString)"2--"+ss.str().c_str()); 36 } 37 38 { 39 //boost::progress_timer t3(ss); 40 //boost::progress_timer t(ss); 41 Sleep(3002); 42 //Form4->Memo1->Lines->Add((AnsiString)"3--"+ss.str().c_str()); 43 } 44 } 45 46 47 //--------------------------------------------------------------------------- 48 void __fastcall TForm4::Button1Click(TObject *Sender) 49 { 50 std::stringstream ss; 51 test_timer(ss); 52 this->Memo1->Lines->Add(ss.str().c_str()); 53 } 54 //---------------------------------------------------------------------------
相关文章推荐
- C++ builder 2010 操作Excel表格的编程实现
- VS2010 C++ 操作Excel表格的编程实现
- C++ builder 操作Excel方法(据网上资料整理)
- c++ builder TreeView控件节点遍历
- c++ builder ListView实现可编辑任意列(转)
- C++ Builder技巧集锦
- c++ builder TListView控件按字符串排序(根据网上代码亲测ok)
- vc++ 实现dir一个目录中所有文件功能
- 使用GDB命令行调试器调试C/C++程序
- C语言 程序代码编写规范
- C++this指针
- Subsets II
- C语言里面的 malloc 函数
- 知无涯之C++ typename的起源与用法
- c++ 时间和日期、随机数—— c++复习(四)
- C++内联函数
- iOS OC语言: Block底层实现原理
- c++ std::bind用法小结。
- C++友元1
- C++友元