1
0
mirror of https://github.com/maximebf/php-debugbar.git synced 2025-01-17 13:28:35 +01:00

Show microseconds

Many small PDO queries will report 0ms. This will show microseconds when appropriate.
This commit is contained in:
Barry vd. Heuvel 2013-10-02 10:50:24 +02:00
parent 3e0c9e3b4c
commit 9e9ca24a62

View File

@ -52,7 +52,9 @@ abstract class DataCollector implements DataCollectorInterface
*/ */
public function formatDuration($seconds) public function formatDuration($seconds)
{ {
if ($seconds < 1) { if($seconds < 0.001){
return round($seconds * 1000000) . 'μs';
}elseif ($seconds < 1) {
return round($seconds * 1000) . 'ms'; return round($seconds * 1000) . 'ms';
} }
return round($seconds, 2) . 's'; return round($seconds, 2) . 's';