You are here

protected function HtmlDumper::formatTime in Devel 8.3

Same name and namespace in other branches
  1. 8 webprofiler/src/Twig/Dumper/HtmlDumper.php \Drupal\webprofiler\Twig\Dumper\HtmlDumper::formatTime()
  2. 8.2 webprofiler/src/Twig/Dumper/HtmlDumper.php \Drupal\webprofiler\Twig\Dumper\HtmlDumper::formatTime()
  3. 4.x webprofiler/src/Twig/Dumper/HtmlDumper.php \Drupal\webprofiler\Twig\Dumper\HtmlDumper::formatTime()

File

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

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);
}