string Timer::relativeThroughputString(size_t uiRelativeToItems, const string & strItemsname) const { string s; return getDescription() + double2String(uiRelativeToItems / getAccumulatedTime(), cuiSecDigits_After_Period, s) + " " + (strItemsname.length() == 0 ? (string)_TEXT("items") : strItemsname) + _TEXT("/second"); }
string Timer::percentString(double dRelativeToSeconds) const { string s; return getDescription() + double2String(100.0 * (getAccumulatedTime() / dRelativeToSeconds), cuiPctDigits_After_Period, s) + _TEXT("%"); }
string Timer::timeAndPercentAndThroughputString( double dRelativeToSeconds, size_t uiRelativeToItems, const string & strItemsname ) const { string s; string s2; return getDescription() + strpad_l_copy(double2String(getAccumulatedTime(), cuiSecDigits_After_Period, s), (size_t)6) + _TEXT(" seconds (") + strpad_l_copy(double2String(100.0 * (getAccumulatedTime() / dRelativeToSeconds), cuiPctDigits_After_Period , s), (size_t)cuiPctDigits_After_Period+3) + _TEXT("% ") + double2String(uiRelativeToItems / getAccumulatedTime(), cuiPctDigits_After_Period, s2) + _TEXT(" ") + (strItemsname.length() == 0 ? (string)_TEXT("items") : strItemsname) + _TEXT("/sec)"); }
string Timer::timeAndPercentString(double dRelativeToSeconds) const { string strAccumulatedTime("0"); double dRelativeTime = 0.0; if (getAccumulatedTime() > FLT_MIN) { double2String(getAccumulatedTime(), cuiSecDigits_After_Period, strAccumulatedTime); dRelativeTime = (getAccumulatedTime() / dRelativeToSeconds); } string strRelativePct; double2String(100.0 * dRelativeTime, cuiPctDigits_After_Period , strRelativePct); return (getDescription() + strpad_l_copy(strAccumulatedTime, (size_t)6) + _TEXT(" seconds (") + strpad_l_copy(strRelativePct, (size_t)cuiPctDigits_After_Period+3) + _TEXT("%)")); }
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(); }
string Timer::timeString() const { return getDescription() + timeString(getAccumulatedTime()); }