/** * Executes stop or start methods on $_stat object * * @param string $action * @param string $timerId * @param int $time * @param int $realMemory * @param int $emallocMemory */ protected function _executeTimerAction($action, $timerId, $time = 0, $realMemory = 0, $emallocMemory = 0) { switch ($action) { case 'start': $this->_stat->start($timerId, $time, $realMemory, $emallocMemory); break; case 'stop': $this->_stat->stop($timerId, $time, $realMemory, $emallocMemory); break; default: $this->fail("Unexpected action '{$action}'"); break; } }
/** * Start collecting statistics for specified timer * * @param string $timerId * @param array|null $tags * @return void * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ public function start($timerId, array $tags = null) { $this->_stat->start($timerId, microtime(true), memory_get_usage(true), memory_get_usage()); }