public function getProfilingReport($print = false)
    {
        // Check for existing profilingDetails ...
        if (null !== $details = $this->getProfilingDetails()) {
            $methodName       = $this->invokedMethod();
            $countInvocations = $details['invocations'];

            if (1 === $countInvocations) {
                $report = sprintf('%s took %ss', $methodName, $details['duration']['microseconds']['average']);
            } else {
                $report = sprintf('%s was invoked %s times\n', $methodName, $countInvocations);
                $report .= sprintf('Total duration:   %sms\n', $details['duration']['microseconds']['total']);
                $report .= sprintf('Average duration: %sms\n', $details['duration']['microseconds']['average']);
                $report .= sprintf('Worst duration:   %sms\n', $details['duration']['microseconds']['worst']);
            }

            if (true === $print) {
                echo $report;
            }
        }

        return $report;
    }
public function getProfilingReport($print = false)
    {
        // Check for existing profilingDetails ...
        if (null !== $details = $this->getProfilingDetails()) {
            $methodName       = $this->invokedMethod();
            $countInvocations = $details['invocations'];

            if (1 === $countInvocations) {
                $report = sprintf('%s took %ss', $methodName, $details['duration']['microseconds']['average']);
            } else {
                $report = sprintf('%s was invoked %s times\n', $methodName, $countInvocations);
                $report .= sprintf('Total duration:   %sms\n', $details['duration']['microseconds']['total']);
                $report .= sprintf('Average duration: %sms\n', $details['duration']['microseconds']['average']);
                $report .= sprintf('Worst duration:   %sms\n', $details['duration']['microseconds']['worst']);
            }

            if (true === $print) {
                echo $report;
            }
        }

        return $report;
    }
public function getProfilingReport ( $ print = false ) { // Check for existing profilingDetails ... if ( null !== $ details = $ this -> getProfilingDetails ( ) ) { $ methodName = $ this -> invokedMethod ( ) ; $ countInvocations = $ details [ 'invocations' ] ; if ( 1 === $ countInvocations ) { $ report = sprintf ( '%s took %ss' , $ methodName , $ details [ 'duration' ] [ 'microseconds' ] [ 'average' ] ) ; } else { $ report = sprintf ( '%s was invoked %s times\n' , $ methodName , $ countInvocations ) ; $ report .= sprintf ( 'Total duration:   %sms\n' , $ details [ 'duration' ] [ 'microseconds' ] [ 'total' ] ) ; $ report .= sprintf ( 'Average duration: %sms\n' , $ details [ 'duration' ] [ 'microseconds' ] [ 'average' ] ) ; $ report .= sprintf ( 'Worst duration:   %sms\n' , $ details [ 'duration' ] [ 'microseconds' ] [ 'worst' ] ) ; } if ( true === $ print ) { echo $ report ; } } return $ report ; }
Prints out profilingDetails about the last profiled method.

@param bool $print TRUE to print/echo the profiling-profilingDetails otherwise it returns the data

@author Benjamin Carl <opensource@clickalicious.de>

@return string|null Report of last profiling operation
Prints out profilingDetails about the last profiled method .