Skip to content

Commit 77903c3

Browse files
committed
Allow show the rendering time of messages
1 parent 1d25624 commit 77903c3

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

src/Debug/LanguageCollector.php

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,9 @@ protected function renderRenderedMessages() : string
7878
}
7979
$count = \count($this->getData());
8080
\ob_start(); ?>
81-
<p><?= $count ?> message<?= $count === 1 ? '' : 's' ?> has been rendered.</p>
81+
<p><?= $count ?> message<?= $count === 1 ? '' : 's' ?> has been rendered
82+
in <?= $this->getStatementsTime() ?> ms:
83+
</p>
8284
<table>
8385
<thead>
8486
<tr>
@@ -109,6 +111,16 @@ protected function renderRenderedMessages() : string
109111
return \ob_get_clean(); // @phpstan-ignore-line
110112
}
111113

114+
protected function getStatementsTime() : float
115+
{
116+
$time = .0;
117+
foreach ($this->getData() as $data) {
118+
$total = $data['end'] - $data['start'];
119+
$time += $total;
120+
}
121+
return Debugger::roundSecondsToMilliseconds($time);
122+
}
123+
112124
protected function renderDirectories() : string
113125
{
114126
$directories = $this->language->getDirectories();

0 commit comments

Comments
 (0)