className = get_class($this->handler[0]); $this->methodName = $this->handler[1]; } /** * @return mixed|void */ public function invoke() { $startTime = microtime(true); $data = call_user_func($this->handler, func_get_args()); $this->print_runtime($startTime); return $data; } private function print_runtime($startTime) { $runTime = round(microtime(true) - $startTime, 6); echo sprintf('run %s::%s use time %6f', $this->className, $this->methodName, $runTime); echo PHP_EOL; } }