src/Base/Logger/StdioLogger.php
public function profile($message = null, $endId = null, $traceShift = 0) {
        if (!isset($endId)) {
            $timeStart = microtime(true);
            $endId = ceil($timeStart * 100000) . mt_rand(11111, 99999);
            $this->profilerData[$endId] = [
                'message' => $message,
                'start' => $timeStart,
                'shift' => $traceShift,
            ];
            return $endId;
        } else {
            $data = ArrayHelper::remove($this->profilerData, $endId, null);
            if (!isset($data)) {
                return null;
            }
            $traceShift = isset($traceShift) ? $traceShift : (int)$data['shift'];
            $message = isset($message) ? $message : (string)$data['message'];
            if ($message === "") {
                $message = '{EMPTY MESSAGE}';
            }
            $timeSpent = (microtime(true) - $data['start']) * 1000;
            $message .= "\nTime: {_timeSpent} ms. Memory usage: {_memoryUsage} MB";
            $memoryUsage = memory_get_usage() / (1024 * 1024);
            $this->debug($message, [
                '_timeSpent' => sprintf('%.2f', $timeSpent),
                '_memoryUsage' => sprintf('%.2f', $memoryUsage),
            ], $traceShift);
        }
        return null;
    }
public function profile($message = null, $endId = null, $traceShift = 0) {
        if (!isset($endId)) {
            $timeStart = microtime(true);
            $endId = ceil($timeStart * 100000) . mt_rand(11111, 99999);
            $this->profilerData[$endId] = [
                'message' => $message,
                'start' => $timeStart,
                'shift' => $traceShift,
            ];
            return $endId;
        } else {
            $data = ArrayHelper::remove($this->profilerData, $endId, null);
            if (!isset($data)) {
                return null;
            }
            $traceShift = isset($traceShift) ? $traceShift : (int)$data['shift'];
            $message = isset($message) ? $message : (string)$data['message'];
            if ($message === "") {
                $message = '{EMPTY MESSAGE}';
            }
            $timeSpent = (microtime(true) - $data['start']) * 1000;
            $message .= "\nTime: {_timeSpent} ms. Memory usage: {_memoryUsage} MB";
            $memoryUsage = memory_get_usage() / (1024 * 1024);
            $this->debug($message, [
                '_timeSpent' => sprintf('%.2f', $timeSpent),
                '_memoryUsage' => sprintf('%.2f', $memoryUsage),
            ], $traceShift);
        }
        return null;
    }
Profiler
@param string $message
@param string $endId
@param int    $traceShift
@return null|string