void ProfileNode::stopProfiling() { ASSERT(!m_calls.isEmpty()); if (isnan(m_calls.last().totalTime())) endAndRecordCall(); // Because we iterate in post order all of our children have been stopped before us. for (unsigned i = 0; i < m_children.size(); ++i) m_selfTime += m_children[i]->totalTime(); ASSERT(m_selfTime <= m_totalTime); m_selfTime = m_totalTime - m_selfTime; }
void ProfileNode::stopProfiling() { if (m_startTime) endAndRecordCall(); ASSERT(m_selfTime == 0.0 && m_startTime == 0.0); // Because we iterate in post order all of our children have been stopped before us. for (unsigned i = 0; i < m_children.size(); ++i) m_selfTime += m_children[i]->totalTime(); ASSERT(m_selfTime <= m_totalTime); m_selfTime = m_totalTime - m_selfTime; }
ProfileNode* ProfileNode::didExecute() { endAndRecordCall(); return m_parent; }