diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/time.html.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/time.html.twig index 962550b0e0..c366edd234 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/time.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/time.html.twig @@ -221,10 +221,10 @@ context.font = "12px sans-serif"; var text = event.name; var ms; - if (event.totaltime == 0) { - ms = " < 1 ms"; - } else { + if (event.totaltime < 1) { ms = " ~ " + event.totaltime + " ms"; + } else { + ms = " ~ " + parseInt(event.totaltime) + " ms"; } if (x + event.starttime * ratio + context.measureText(text + ms).width > width) { context.textAlign = "end"; diff --git a/src/Symfony/Component/HttpKernel/Debug/StopwatchEvent.php b/src/Symfony/Component/HttpKernel/Debug/StopwatchEvent.php index 787bc7f940..e26fcbd1f8 100644 --- a/src/Symfony/Component/HttpKernel/Debug/StopwatchEvent.php +++ b/src/Symfony/Component/HttpKernel/Debug/StopwatchEvent.php @@ -139,11 +139,11 @@ class StopwatchEvent $total += $period[1] - $period[0]; } - return (int) sprintf('%d', $total); + return sprintf('%.1f', $total); } private function getNow() { - return (int) sprintf('%d', microtime(true) * 1000 - $this->origin); + return sprintf('%.1f', microtime(true) * 1000 - $this->origin); } }