This commit is contained in:
Walzer 2010-12-18 08:17:53 +08:00
parent 6de3f0f404
commit 5f563102e9
2 changed files with 4 additions and 4 deletions

View File

@ -109,14 +109,14 @@ namespace cocos2d
void CCProfilingBeginTimingBlock(CCProfilingTimer *pTimer)
{
CCTime::gettimeofday(&pTimer->getStartTime(), NULL);
CCTime::gettimeofdayCocos2d(&pTimer->getStartTime(), NULL);
}
void CCProfilingEndTimingBlock(CCProfilingTimer *pTimer)
{
struct cc_timeval currentTime;
CCTime::gettimeofday(&currentTime, NULL);
CCTime::timersub(&currentTime, &pTimer->getStartTime(), &currentTime);
CCTime::gettimeofdayCocos2d(&currentTime, NULL);
CCTime::timersubCocos2d(&currentTime, &pTimer->getStartTime(), &currentTime);
double duration = currentTime.tv_sec * 1000.0 + currentTime.tv_usec / 1000.0;
// return in milliseconds

View File

@ -46,7 +46,7 @@ namespace cocos2d
bool init(void);
public:
static CCProfiler* getSharedProfiler(void);
static CCProfiler* sharedProfiler(void);
static CCProfilingTimer* timerWithName(const char *pszTimerName, NSObject *pInstance);
static void releaseTimer(CCProfilingTimer *pTimer);