本文整理汇总了C++中Timer::Finish方法的典型用法代码示例。如果您正苦于以下问题:C++ Timer::Finish方法的具体用法?C++ Timer::Finish怎么用?C++ Timer::Finish使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Timer
的用法示例。
在下文中一共展示了Timer::Finish方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(void)
{
int i, count;
Timer t;
count = 1000000;
t.Start();
for(i = 0; i < count; i++){
twine tmp;
tmp.format("This is (%d) a message (%s) with several (%f) "
"replacement (%d) parameters (%s)",
i, "hithere everyone", 3.14159f, i*2,
"interesting isn't it? ;-)");
}
t.Finish();
printf("Time for %d twine::format calls is (%f)\n",
count, t.Duration());
return 0;
}
示例2: ee
void *run_lots(void* v)
{
EnEx ee("run_lots()", true);
int i, j;
Timer tt;
tt.Start();
for(j = 0; j < 20; j++){
EnEx eeo("run_lots() - main loop");
vector < data_class * > *myvect;
myvect = new vector < data_class * >;
string accumulator;
for(i = 0; i < 60000; i++){
EnEx eei("run_lots() - inner loop");
data_class *dat = new data_class();
dat->field1 = "field 1 value";
dat->field2 = "field 2 value";
dat->field3 = dat->field1;
dat->field3 += dat->field2;
dat->field4 = "57.89f";
dat->field5 = "A string ";
dat->field5 += "35 ";
dat->field5 += "38.99";
dat->i1 = 18;
dat->i2 = 19;
dat->i3 = dat->i1 * dat->i2;
dat->field6 = "ANumber";
dat->field7 = "AnotherNumber";
dat->field8 = "AThirdNumber";
dat->field9 = dat->field2.substr(3, 5);
if(dat->field1 > dat->field2)
dat->fielda = "true";
else
dat->fielda = "false";
myvect->push_back(dat);
accumulator += dat->field8;
}
for(i = 0; i < (int)myvect->size(); i++){
delete (*myvect)[i];
}
delete myvect;
}
tt.Finish();
printf("Duration for the regular stuff is (%f)\n", tt.Duration());
tt.Start();
for(j = 0; j < 20; j++){
for(i = 0; i < 60000; i++){
string ret_tmp;
ret_tmp = func1("interesting");
}
}
tt.Finish();
printf("Duration for the func stuff is (%f)\n", tt.Duration());
return (void*)NULL;
}