Skip to content

Commit

Permalink
Skip decimals if < 100ms
Browse files Browse the repository at this point in the history
  • Loading branch information
barryvdh authored Apr 16, 2020
1 parent 2009a58 commit 40f3755
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/DebugBar/DataFormatter/DataFormatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,10 @@ public function formatDuration($seconds)
{
if ($seconds < 0.001) {
return round($seconds * 1000000) . 'μs';
} elseif ($seconds < 1) {
} elseif ($seconds < 0.1) {
return round($seconds * 1000, 2) . 'ms';
} elseif ($seconds < 1) {
return round($seconds * 1000) . 'ms';
}
return round($seconds, 2) . 's';
}
Expand Down

0 comments on commit 40f3755

Please sign in to comment.