function HtmlDumper::formatTime

File

webprofiler/src/Twig/Dumper/HtmlDumper.php, line 32

Class

HtmlDumper
Class HtmlDumper

Namespace

Drupal\webprofiler\Twig\Dumper

Code

protected function formatTime(\Twig_Profiler_Profile $profile, $percent) {
    return sprintf('<span style="color: %s">%.2fms/%.0f%%</span>', $percent > 20 ? self::$colors['big'] : 'auto', $profile->getDuration() * 1000, $percent);
}