本文整理汇总了C++中Stopwatch::total方法的典型用法代码示例。如果您正苦于以下问题:C++ Stopwatch::total方法的具体用法?C++ Stopwatch::total怎么用?C++ Stopwatch::total使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Stopwatch
的用法示例。
在下文中一共展示了Stopwatch::total方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main( int argc, char **argv ){
Stopwatch timer;
// For each circular search vector size
for(int l=0; l < 4; l++){
std::cout << br << "\nCircular Search Size: " << vectorSize[l] << "\n";
// Big V
for(size_t v = 0; v < BIG_V_SIZE; v++){
std::cout << "V[" << v << "] - circularSize: " << LITTLE_V_SIZE + vectorSize[l] << "\n";
V[v] = generateRandomVector(BIG_V_SIZE);
pid_t pid;
int g = 0;
pid_t pID = fork();
if (pID < 0) { std::cerr << "Failed to fork" << std::endl;exit(1);}
if (pID == 0) { //child
g = 0;
std::cout << "Child Process" << g << std::endl;
} else { // parent
std::cout << "Parent Process:" << g << std::endl;;
++g;
}
// little v
for(int i = 0; i < LITTLE_V_SIZE + vectorSize[l]; i++){
// std::cout << i << ":" << i%LITTLE_V_SIZE << ":" << V[v][i%LITTLE_V_SIZE] << ", ";
TV[i%vectorSize[l]] = V[v][i%LITTLE_V_SIZE];
}
}
}
timer.stop();
std::cout << "\n\noperation took " << timer.total() << " seconds\n";
return 0;
}