本文整理汇总了C++中CPUTimer::getTime方法的典型用法代码示例。如果您正苦于以下问题:C++ CPUTimer::getTime方法的具体用法?C++ CPUTimer::getTime怎么用?C++ CPUTimer::getTime使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CPUTimer
的用法示例。
在下文中一共展示了CPUTimer::getTime方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: benchmark_ts_PLP
void benchmark_ts_PLP(tsppi::TsPpiGraph& tsppi, bool printHist=false)
{
CPUTimer timer;
double naive_time, fast_time;
LOG("Start Benchmark: Naive");
timer.start();
std::vector<NetworKit::Partition > partitions = tsppi::algo::subgraph_PLP(tsppi.subgraphs);
timer.stop();
naive_time = timer.getTime();
LOG("Time for Naive: " << timer.getTime() << " s");
LOG("Start Benchmark: Fast");
timer.start();
std::vector<NetworKit::Partition > partitions_2 = tsppi::algo::subgraph_PLP_vec(tsppi.subgraphs);
timer.stop();
fast_time = timer.getTime();
LOG("Time for Fast: " << timer.getTime() << " s");
// print histogram
if (printHist)
{
std::cout << "Histogram of cluster sizes for Naive:" << std::endl;
clusterSizeHist(partitions);
std::cout << "Histogram of cluster sizes for fast:" << std::endl;
clusterSizeHist(partitions_2);
}
// print timings
std::cout << naive_time << ";" << fast_time;
}
示例2: benchmark_ts_clustercoeff
void benchmark_ts_clustercoeff(tsppi::TsPpiGraph& tsppi)
{
CPUTimer timer;
double naive_time, fast_time, faster_time;
LOG("Start Benchmark: Naive");
timer.start();
std::vector<std::vector<double> > naive_ts_bw = tsppi::algo::subgraph_cc(tsppi.subgraphs);
timer.stop();
naive_time = timer.getTime();
LOG("Time for Naive: " << timer.getTime() << " s");
LOG("Start Benchmark: Fast");
timer.start();
std::vector<std::vector<double> > fast_ts_bw = tsppi::algo::subgraph_cc_neighbor_comb(tsppi.subgraphs);
timer.stop();
fast_time = timer.getTime();
LOG("Time for Fast: " << timer.getTime() << " s");
LOG("Start Benchmark: Fast");
timer.start();
std::vector<std::vector<double> > faster_ts_bw = tsppi::algo::subgraph_cc_neighbor_comb_vec(tsppi.subgraphs);
timer.stop();
faster_time = timer.getTime();
LOG("Time for Fast: " << timer.getTime() << " s");
std::cout << naive_time << ";" << fast_time << ";" << faster_time;
}
示例3: benchmark_ts_betweenness
void benchmark_ts_betweenness(tsppi::TsPpiGraph& tsppi)
{
CPUTimer timer;
double naive_time, fast_time;
LOG("Start Benchmark: Naive");
timer.start();
std::vector<std::vector<double> > naive_ts_bw = tsppi::algo::subgraph_betweenness(tsppi.subgraphs);
timer.stop();
naive_time = timer.getTime();
LOG("Time for Naive: " << timer.getTime() << " s");
LOG("Start Benchmark: Fast");
timer.start();
std::vector<std::vector<double> > fast_ts_bw = tsppi::algo::subgraph_betweenness_fast(tsppi.subgraphs);
timer.stop();
fast_time = timer.getTime();
LOG("Time for Fast: " << timer.getTime() << " s");
std::cout << naive_time << ";" << fast_time;
}