c++ boost--------------boost::progress_timer小试。

 //---------------------------------------------------------------------------

 #include <vcl.h>
#pragma hdrstop #include "Unit4.h"
#include <boost/progress.hpp>
#include <sstream>
using namespace std;
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm4 *Form4;
//---------------------------------------------------------------------------
__fastcall TForm4::TForm4(TComponent* Owner)
: TForm(Owner)
{
} void test_timer(std::stringstream& ss)
{
ss.clear();
boost::progress_timer t(ss); {
//boost::progress_timer t1(ss);
Sleep();
//Form4->Memo1->Lines->Add((AnsiString)"1--"+ss.str().c_str());
} {
//boost::progress_timer t2(ss);
//boost::progress_timer t(ss);
Sleep();
//Form4->Memo1->Lines->Add((AnsiString)"2--"+ss.str().c_str());
} {
//boost::progress_timer t3(ss);
//boost::progress_timer t(ss);
Sleep();
//Form4->Memo1->Lines->Add((AnsiString)"3--"+ss.str().c_str());
}
} //---------------------------------------------------------------------------
void __fastcall TForm4::Button1Click(TObject *Sender)
{
std::stringstream ss;
test_timer(ss);
this->Memo1->Lines->Add(ss.str().c_str());
}
//---------------------------------------------------------------------------
上一篇:grunt concat针对有依赖文件的js脚本的合并


下一篇:Java从零开始学二十四(集合工具类Collections)