本文整理汇总了C++中Benchmark::GetShortName方法的典型用法代码示例。如果您正苦于以下问题:C++ Benchmark::GetShortName方法的具体用法?C++ Benchmark::GetShortName怎么用?C++ Benchmark::GetShortName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Benchmark
的用法示例。
在下文中一共展示了Benchmark::GetShortName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Shootout
//.........这里部分代码省略.........
)
{
// Check the sum of all results and if the sum is ok,
// check the last result of the benchmark run.
pBench->AddFail(vExpr[i]);
++failure_count;
}
results[time].push_back(pBench);
}
output(pRes, "\n");
int ct = 1;
int parser_index = 0;
for (auto it = results.begin(); it != results.end(); ++it)
{
const std::vector<Benchmark*>& vBench = it->second;
for (std::size_t k = 0; k < vBench.size(); ++k)
{
Benchmark* pBench = vBench[k];
if (pBench->ExpressionFailed(current_expr))
{
continue;
}
pBench->AddPoints(vBenchmarks.size() - ct + 1);
pBench->AddScore(pRefBench->GetTime() / pBench->GetTime() );
output(pRes, "[%02d] %-20s (%9.3f ns, %26.18f, %26.18f)\n",
static_cast<int>(++parser_index),
pBench->GetShortName().c_str(),
it->first,
pBench->GetRes(),
pBench->GetSum());
}
ct += vBench.size();
}
if (failure_count)
{
output(pRes, "DNQ List\n");
parser_index = 0;
for (auto it = results.begin(); it != results.end(); ++it)
{
const std::vector<Benchmark*>& vBench = it->second;
for (std::size_t k = 0; k < vBench.size(); ++k)
{
Benchmark* pBench = vBench[k];
if (!pBench->ExpressionFailed(current_expr))
continue;
pBench->AddPoints(0);
pBench->AddScore(0);
if (pBench->DidNotEvaluate())
{
output(pRes, "[%02d] %-20s (%s)\n",
static_cast<int>(++parser_index),
pBench->GetShortName().c_str(),
pBench->GetFailReason().c_str());