Skip to content

Commit 9a0201d

Browse files
committed
Merge branch 'development'
2 parents 1196b3d + 04c399a commit 9a0201d

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

src/Debug/DatabaseCollector.php

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,9 @@ public function getContents() : string
6161
return \ob_get_clean(); // @phpstan-ignore-line
6262
}
6363
$count = \count($this->getData()); ?>
64-
<p>Ran <?= $count ?> statement<?= $count === 1 ? '' : 's' ?>:</p>
64+
<p>Ran <?= $count ?> statement<?= $count === 1 ? '' : 's' ?>
65+
in <?= $this->getStatementsTime() ?> ms:
66+
</p>
6567
<table>
6668
<thead>
6769
<tr>
@@ -92,6 +94,16 @@ public function getContents() : string
9294
return \ob_get_clean(); // @phpstan-ignore-line
9395
}
9496

97+
protected function getStatementsTime() : float
98+
{
99+
$time = .0;
100+
foreach ($this->getData() as $data) {
101+
$total = $data['end'] - $data['start'];
102+
$time += $total;
103+
}
104+
return Debugger::roundSecondsToMilliseconds($time);
105+
}
106+
95107
protected function showHeader() : string
96108
{
97109
$config = $this->database->getConfig();

0 commit comments

Comments
 (0)