Skip to content

Commit

Permalink
Show times as milliseconds
Browse files Browse the repository at this point in the history
  • Loading branch information
natanfelles committed Jan 5, 2025
1 parent ba25331 commit b774a1b
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/Debug/RoutingCollector.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

use Closure;
use Framework\Debug\Collector;
use Framework\Debug\Debugger;
use Framework\Routing\RouteCollection;
use Framework\Routing\Router;

Expand Down Expand Up @@ -135,8 +136,8 @@ protected function renderMatchedRoute() : string
<th>Action</th>
<th>Name</th>
<th>Has Options</th>
<th title="Seconds">Time to Match</th>
<th title="Seconds">Runtime</th>
<th title="Milliseconds">Time to Match</th>
<th title="Milliseconds">Runtime</th>
</tr>
</thead>
<tbody>
Expand All @@ -159,13 +160,13 @@ protected function renderMatchedRoute() : string
<td><?php
foreach ($this->getData() as $data) {
if ($data['type'] === 'match') {
echo \round($data['end'] - $data['start'], 6);
echo Debugger::roundSecondsToMilliseconds($data['end'] - $data['start']);
}
} ?></td>
<td><?php
foreach ($this->getData() as $data) {
if ($data['type'] === 'run') {
echo \round($data['end'] - $data['start'], 6);
echo Debugger::roundSecondsToMilliseconds($data['end'] - $data['start']);
}
} ?></td>
</tr>
Expand Down Expand Up @@ -214,8 +215,8 @@ protected function renderRouteCollectionTime(RouteCollection $collection) : stri
foreach ($this->getData() as $data) {
if ($data['type'] === 'serve' && $data['collectionId'] === \spl_object_id($collection)) {
$contents = '<p title="Seconds"><strong>Time to Serve:</strong> '
. \round($data['end'] - $data['start'], 6)
. '</p>';
. Debugger::roundSecondsToMilliseconds($data['end'] - $data['start'])
. ' ms</p>';
break;
}
}
Expand Down

0 comments on commit b774a1b

Please sign in to comment.