string ProfileSample::toString(void) const { StringStream msg; msg << m_Name //<< ",OpenCount:" << m_OpenCount << ",AverageTime:" << getAverageTime() << ",AccuTime:" << getAccumulatedTime() << ",CallCount:" << m_CallCount //<< ",ParentCount:" << m_ParentCount << ",ChildTime:" << getChildrenTime(); return msg.toString(); }
double RecordEntry::getTime() { string estimationMethod = TIS::getInstance().getTimeEstimationMethod(); double value = 0; if (estimationMethod == "last") { value= getLatestTime(); } if (estimationMethod == "decay") { value = getDecayTime(); } if (estimationMethod == "average") { value = getAverageTime(); } return value; }
std::string PerfTimer::getFormattedTime(bool isShowAverage) const { string show_name = name_; if(!desc_.empty()) { show_name = desc_; } char str[1000]; if(isShowAverage) { sprintf(str, "%s: %0.3lfs (%0.2lf fps, %0.3lfms)", show_name.c_str(), getTime(), getFPS(), getAverageTime() * 1000.0); } else { sprintf(str, "%s: %0.3lfs", show_name.c_str(), getTime()); } string ret(str); return ret; }
void print() const {std::cout << m_name << " (# " << m_number << "): " << getAverageTime() << " s" << std::endl;}