Skip to content

Commit

Permalink
normalize ms to 2 decimal places
Browse files Browse the repository at this point in the history
  • Loading branch information
andrepereiradasilva committed Jan 14, 2016
1 parent 832e908 commit 7fcc15a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions plugins/system/debug/debug.php
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,7 @@ protected function displayProfileInformation()
$totalTime += $mark->time;
$totalMem += $mark->memory;
$htmlMark = sprintf(
JText::_('PLG_DEBUG_TIME') . ': <span class="label label-time">%.1f&nbsp;ms</span> / <span class="label label-default">%.1f&nbsp;ms</span>'
JText::_('PLG_DEBUG_TIME') . ': <span class="label label-time">%.2f&nbsp;ms</span> / <span class="label label-default">%.2f&nbsp;ms</span>'
. ' ' . JText::_('PLG_DEBUG_MEMORY') . ': <span class="label label-memory">%0.3f MB</span> / <span class="label label-default">%0.2f MB</span>'
. ' %s: %s',
$mark->time,
Expand Down Expand Up @@ -582,7 +582,7 @@ protected function displayProfileInformation()
$bars[] = (object) array(
'width' => round($mark->time / ($totalTime / 100), 4),
'class' => $barClass,
'tip' => $mark->tip . ' ' . round($mark->time, 1) . ' ms'
'tip' => $mark->tip . ' ' . round($mark->time, 2) . ' ms'
);

$barsMem[] = (object) array(
Expand Down Expand Up @@ -646,7 +646,7 @@ protected function displayProfileInformation()

$html[] = '<br /><div>' . JText::sprintf(
'PLG_DEBUG_QUERIES_TIME',
sprintf('<span class="label ' . $labelClass . '">%.1f&nbsp;ms</span>', $totalQueryTime)
sprintf('<span class="label ' . $labelClass . '">%.2f&nbsp;ms</span>', $totalQueryTime)
) . '</div>';

if ($this->params->get('log-executed-sql', '0'))
Expand Down Expand Up @@ -1094,7 +1094,7 @@ protected function displayQueries()
$html = array();

$html[] = '<h4>' . JText::sprintf('PLG_DEBUG_QUERIES_LOGGED', $this->totalQueries)
. sprintf(' <span class="label ' . $labelClass . '">%.1f&nbsp;ms</span>', ($totalQueryTime)) . '</h4><br />';
. sprintf(' <span class="label ' . $labelClass . '">%.2f&nbsp;ms</span>', ($totalQueryTime)) . '</h4><br />';

if ($total_duplicates)
{
Expand Down Expand Up @@ -1280,7 +1280,7 @@ protected function tableToHtml($table, &$hasWarnings)
}

// Display duration in milliseconds with the unit instead of seconds.
$html[] = sprintf('%.1f&nbsp;ms', $td * 1000);
$html[] = sprintf('%.2f&nbsp;ms', $td * 1000);
}
elseif ($k == 'Error')
{
Expand Down

0 comments on commit 7fcc15a

Please sign in to comment.