public function getTotalTime(bool $indexed = false)
    {
        if ($this->profiles == null) {
            return null;
        }

        $totalTime = 0.00;
        $totalTimeIndexed = '';
        if (isset($this->profiles['connection'])) {
            $totalTime += $this->profiles['connection']['time'];
            if ($indexed) {
                $totalTimeIndexed .= "connection({$totalTime})";
            }
        }

        if (isset($this->profiles['query'])) {
            foreach ($this->profiles['query'] as $i => $profile) {
                $totalTime += $profile['time'];
                if ($indexed) {
                    $totalTimeIndexed .= " query{$i}({$profile['time']})";
                }
            }
        }

        return !$indexed ? $totalTime : $totalTimeIndexed;
    }
public function getTotalTime(bool $indexed = false)
    {
        if ($this->profiles == null) {
            return null;
        }

        $totalTime = 0.00;
        $totalTimeIndexed = '';
        if (isset($this->profiles['connection'])) {
            $totalTime += $this->profiles['connection']['time'];
            if ($indexed) {
                $totalTimeIndexed .= "connection({$totalTime})";
            }
        }

        if (isset($this->profiles['query'])) {
            foreach ($this->profiles['query'] as $i => $profile) {
                $totalTime += $profile['time'];
                if ($indexed) {
                    $totalTimeIndexed .= " query{$i}({$profile['time']})";
                }
            }
        }

        return !$indexed ? $totalTime : $totalTimeIndexed;
    }
public function getTotalTime ( bool $ indexed = false ) { if ( $ this -> profiles == null ) { return null ; } $ totalTime = 0.00 ; $ totalTimeIndexed = '' ; if ( isset ( $ this -> profiles [ 'connection' ] ) ) { $ totalTime += $ this -> profiles [ 'connection' ] [ 'time' ] ; if ( $ indexed ) { $ totalTimeIndexed .= "connection({$totalTime})" ; } } if ( isset ( $ this -> profiles [ 'query' ] ) ) { foreach ( $ this -> profiles [ 'query' ] as $ i => $ profile ) { $ totalTime += $ profile [ 'time' ] ; if ( $ indexed ) { $ totalTimeIndexed .= " query{$i}({$profile['time']})" ; } } } return ! $ indexed ? $ totalTime : $ totalTimeIndexed ; }
Get total time.
@param  bool $indexed
@return float|string|null
Get total time .