void CCProfiler::displayTimers() { CCDictElement* pElement = NULL; CCDICT_FOREACH(m_pActiveTimers, pElement) { CCProfilingTimer* timer = (CCProfilingTimer*)pElement->getObject(); CCLog("%s", timer->description()); }
CCProfilingTimer* CCProfiler::createAndAddTimerWithName(const char* timerName) { CCProfilingTimer *t = new CCProfilingTimer(); t->initWithName(timerName); m_pActiveTimers->setObject(t, timerName); t->release(); return t; }
void CCProfiler::displayTimers() { CAMap<std::string, CCProfilingTimer*>::iterator itr; for (itr=m_mActiveTimers.begin(); itr!=m_mActiveTimers.end(); itr++) { CCProfilingTimer* timer = itr->second; CCLog("%s", timer->description()); } }
CCProfilingTimer* CCProfiler::createAndAddTimerWithName(const char* timerName) { CCProfilingTimer *t = new CCProfilingTimer(); t->initWithName(timerName); m_mActiveTimers.insert(timerName, t); t->release(); return t; }
void CCProfilingResetTimingBlock(const char *timerName) { CCProfiler* p = CCProfiler::sharedProfiler(); CCProfilingTimer *timer = p->m_mActiveTimers.getValue(timerName); CCAssert(timer, "CCProfilingTimer not found"); timer->reset(); }
CCProfilingTimer* CCProfiler::timerWithName(const char *pszTimerName, CCObject *pInstance) { CCProfiler *p = CCProfiler::sharedProfiler(); CCProfilingTimer *t = new CCProfilingTimer(); t->initWithName(pszTimerName, pInstance); p->m_pActiveTimers->addObject(t); t->release(); return t; }