Pimcore\Tool\StopWatch::getTime PHP Method

getTime() public static method

public static getTime ( boolean $html = false, string $component = 'default' ) : string
$html boolean
$component string
return string
    public static function getTime($html = false, $component = 'default')
    {
        $text = "";
        $lastLap = self::$startTime[$component];
        foreach (self::$laps[$component] as $label => $time) {
            $text .= "Lap " . $label . "\tAccum: " . ($time - self::$startTime[$component]) . "\t Self: " . ($time - $lastLap) . "\n";
            $lastLap = $time;
        }
        $text .= "Total Time: " . (self::microtime_float() - self::$startTime[$component]) . "\n";
        if ($html) {
            $text = "<pre>" . $text . "</pre>";
        }
        return $text;
    }