1
0
mirror of https://github.com/maximebf/php-debugbar.git synced 2025-03-15 19:59:41 +01:00

fix formatDuration NaNμs on timeline widget (#569)

This commit is contained in:
erikn69 2024-02-10 04:56:34 -05:00 committed by GitHub
parent 7e0ef13788
commit c13bd51cdb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -420,8 +420,10 @@ if (typeof(PhpDebugBar) == 'undefined') {
var formatDuration = function(seconds) {
if (seconds < 0.001)
return (seconds * 1000000).toFixed() + 'μs';
else if (seconds < 1)
else if (seconds < 0.1)
return (seconds * 1000).toFixed(2) + 'ms';
else if (seconds < 1)
return (seconds * 1000).toFixed() + 'ms';
return (seconds).toFixed(2) + 's';
};