本文整理汇总了C++中TimerPtr::getParent方法的典型用法代码示例。如果您正苦于以下问题:C++ TimerPtr::getParent方法的具体用法?C++ TimerPtr::getParent怎么用?C++ TimerPtr::getParent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TimerPtr
的用法示例。
在下文中一共展示了TimerPtr::getParent方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: printTimers
void
Dashboard::printTimers(Table & theTable, TimerPtr theParent, const std::string & theIndent) {
for (unsigned i = 0; i < _mySortedTimers.size(); ++i) {
std::string & myTimerName = _mySortedTimers[i].first;
TimerPtr myTimerPtr = _mySortedTimers[i].second;
if (myTimerPtr->getParent() == theParent) {
theTable.addRow();
theTable.setField("timername", theIndent + myTimerName);
unsigned long myCycleCount = _myGroupCounters[myTimerPtr->getGroup()].getCount();
if (myCycleCount) {
const asl::Timer & myTimer = _myCompleteCycleTimers[myTimerName];
theTable.setField("elapsed",as_string((double)(myTimer.getElapsed().micros())/1000.0/myCycleCount));
const asl::Counter & myCounter = myTimer.getCounter();
if (myCounter.getCount()>1) {
theTable.setField("intervals",as_string((myCounter.getCount()+1.0)/myCycleCount));
theTable.setField("persec",as_string(myCounter.getCount()/myTimer.getElapsed().seconds()));
theTable.setField("average",as_string(myTimer.getElapsed().micros()/1000.0/myCounter.getCount()));
theTable.setField("minimum",as_string(myTimer.getMin().micros()/1000.0));
theTable.setField("maximum",as_string(myTimer.getMax().micros()/1000.0));
theTable.setField("cycles",as_string(myCycleCount));
}
} else {
const asl::Timer & myTimer = *myTimerPtr;
const asl::Counter & myCounter = myTimer.getCounter();
theTable.setField("elapsed",as_string((double)(myTimer.getElapsed().micros())/1000.0));
if (myCounter.getCount()>1) {
theTable.setField("intervals",as_string(myCounter.getCount()));
theTable.setField("persec",as_string(myCounter.getCount()/myTimer.getElapsed().seconds()));
theTable.setField("average",as_string(myTimer.getElapsed().micros()/1000.0));
}
theTable.setField("cycles","incomplete");
}
printTimers(theTable, myTimerPtr, theIndent+" ");
}
}
}