Elgg\Profiler::formatTree PHP Method

formatTree() public method

Nicely format the elapsed time values
public formatTree ( array $tree ) : array
$tree array Result of buildTree()
return array
    public function formatTree(array $tree)
    {
        $tree['duration'] = sprintf($this->duration_format, $tree['duration']);
        if (isset($tree['percentage'])) {
            $tree['percentage'] = sprintf($this->percentage_format, $tree['percentage']);
        }
        if (isset($tree['periods'])) {
            $tree['periods'] = array_map([$this, 'formatTree'], $tree['periods']);
        }
        return $tree;
    }