void SStopWatch::MarkInternal(Root* root) { FlushICache(); root->suspendTime = 0; if ((root->extensions&EXTENSION_PERFORMANCE) != 0) { IOSFastIoctl(CounterFD(), PERFCNT_READ_COUNTERS(NUM_COUNTERS+1), 0, NULL, sizeof(m_node->counters), m_node->counters, &root->perfError); } #if TARGET_PLATFORM == TARGET_PLATFORM_PALMSIM_WIN32 if ((root->extensions&EXTENSION_QUANTIFY_RUNNING) != 0) { QuantifyStopRecordingData(); } if ((root->flags&B_STOP_WATCH_QUANTIFY) != 0) { QuantifyStartRecordingData(); root->extensions |= EXTENSION_QUANTIFY_RUNNING; } #endif if ((root->flags&B_STOP_WATCH_NO_TIME) == 0) { m_node->time = KALGetTime(B_TIMEBASE_RUN_TIME); } #if TARGET_PLATFORM == TARGET_PLATFORM_DEVICE_ARM if ((root->extensions&EXTENSION_PERFORMANCE_HIGH) != 0) { m_node->counters[0] = ReadPerformanceCounter(0); m_node->counters[1] = ReadPerformanceCounter(1); m_node->counters[2] = ReadPerformanceCounter(2); } #endif }
void SStopWatch::Resume() { Root* root = m_root; #if TARGET_PLATFORM == TARGET_PLATFORM_PALMSIM_WIN32 if ((root->flags&B_STOP_WATCH_QUANTIFY) != 0 && (root->extensions&EXTENSION_QUANTIFY_RUNNING) == 0) { QuantifyStartRecordingData(); root->extensions |= EXTENSION_QUANTIFY_RUNNING; } #endif if (root->suspendTime != 0) { m_node->time += KALGetTime(B_TIMEBASE_RUN_TIME) - root->suspendTime; root->suspendTime = 0; } }
stats (int quantify, const char *test_name) : quantify_ (quantify), test_name_ (test_name) { this->timer_.start (); if (this->quantify_) { #if defined (USING_QUANTIFY) // Reset Quantify data recording; whatever happened before this // point is not relevant anymore. QuantifyClearData (); QuantifyStartRecordingData (); #endif /* USING_QUANTIFY */ } }