1
0
mirror of https://github.com/maximebf/php-debugbar.git synced 2025-01-17 05:18:32 +01:00

Merge pull request #34 from barryvdh/patch-1

Show microseconds
This commit is contained in:
Maxime Bouroumeau-Fuseau 2013-10-02 07:12:03 -07:00
commit 84986b1588

View File

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