src/Controller/TimerController.php
protected function miniBenchTo(array $timeKeeping)
    {
        // Get the very first key.
        $start = key($timeKeeping);
        $totalTime = round((end($timeKeeping) - $timeKeeping[$start]) * 1000, 4);
        $result['url'] = $this->getCurrentUrl();
        $result['total_time'] = $totalTime;
        $prevMomentName = $start;
        $prevMomentStart = $timeKeeping[$start];

        foreach ($timeKeeping as $moment => $time) {
            if ($moment !== $start) {
                // Calculate the time.
                $percentageTime = round(((round(($time - $prevMomentStart) * 1000, 4) / $totalTime) * 100), 1);
                $result[$prevMomentName . '->' . $moment] = $percentageTime . '%';
                $prevMomentStart = $time;
                $prevMomentName = $moment;
            }
        }

        return $result;
    }
protected function miniBenchTo(array $timeKeeping)
    {
        // Get the very first key.
        $start = key($timeKeeping);
        $totalTime = round((end($timeKeeping) - $timeKeeping[$start]) * 1000, 4);
        $result['url'] = $this->getCurrentUrl();
        $result['total_time'] = $totalTime;
        $prevMomentName = $start;
        $prevMomentStart = $timeKeeping[$start];

        foreach ($timeKeeping as $moment => $time) {
            if ($moment !== $start) {
                // Calculate the time.
                $percentageTime = round(((round(($time - $prevMomentStart) * 1000, 4) / $totalTime) * 100), 1);
                $result[$prevMomentName . '->' . $moment] = $percentageTime . '%';
                $prevMomentStart = $time;
                $prevMomentName = $moment;
            }
        }

        return $result;
    }
protected function miniBenchTo ( array $ timeKeeping ) { // Get the very first key. $ start = key ( $ timeKeeping ) ; $ totalTime = round ( ( end ( $ timeKeeping ) - $ timeKeeping [ $ start ] ) * 1000 , 4 ) ; $ result [ 'url' ] = $ this -> getCurrentUrl ( ) ; $ result [ 'total_time' ] = $ totalTime ; $ prevMomentName = $ start ; $ prevMomentStart = $ timeKeeping [ $ start ] ; foreach ( $ timeKeeping as $ moment => $ time ) { if ( $ moment !== $ start ) { // Calculate the time. $ percentageTime = round ( ( ( round ( ( $ time - $ prevMomentStart ) * 1000 , 4 ) / $ totalTime ) * 100 ) , 1 ) ; $ result [ $ prevMomentName . '->' . $ moment ] = $ percentageTime . '%' ; $ prevMomentStart = $ time ; $ prevMomentName = $ moment ; } } return $ result ; }
The benchmark main function.

@param array $timeKeeping
The timekeeping array.

@return array
The benchmark array.

@see http://php.net/manual/de/function.microtime.php
@author gomodo at free dot fr
The benchmark main function .