本文整理汇总了C++中SimpleTimer::getTime方法的典型用法代码示例。如果您正苦于以下问题:C++ SimpleTimer::getTime方法的具体用法?C++ SimpleTimer::getTime怎么用?C++ SimpleTimer::getTime使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SimpleTimer
的用法示例。
在下文中一共展示了SimpleTimer::getTime方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: launchExpt
// this function expects that simulation params be updated beforehand
int launchExpt(){
SimpleTimer clockExpt; clockExpt.reset();
clockExpt.start();
cout << "\n> Launch Experiment: " << exptDesc << "_runSet(" << iEns << ")\n";
cout << " > Simulate " << genMax << " generations, plot after every " << plotStep << " steps.\n > ";
cout.flush();
// start run
// int k=0, g=0;
while(1){ // infinite loop needed to poll anim_on signal.
if (graphicsQual > 0) glutMainLoopEvent();
// animate particles
if (b_anim_on) {
animateParticles();
++stepNum;
if (b_displayEveryStep && stepNum % (-dispInterval) == 0) displayDevArrays(); // update display if every step update is on
}
// if indefinite number of steps desired, skip gen-advance check
if (moveStepsPerGen < 0) continue;
// check if generation is to be advanced.
if (stepNum >= moveStepsPerGen){
stepNum = 0;
advanceGen(); // Note: CudaMemCpy at start and end of advanceGen() ensure that all movement kernel calls are done
++genNum;
if (genNum % plotStep == 0) { cout << "."; cout.flush(); }
}
// when genMax genenrations are done, end run
if (genNum >= genMax) break;
}
// end run, reset counters
cout << " > DONE. "; // << "Return to main().\n\n";
printTime_hhmm(clockExpt.getTime());
stepNum = genNum = 0;
++iExpt;
return 0;
}