Skip to content

Commit 082f0a3

Browse files
committed
Outputting elapsed time under the same conditions as used memory
1 parent ef2a246 commit 082f0a3

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/Command/InceptionResult.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -90,17 +90,17 @@ public function getGenerateBaselineFile(): ?string
9090

9191
public function handleReturn(int $exitCode, ?int $peakMemoryUsageBytes, float $analysisStartTime): int
9292
{
93-
if ($peakMemoryUsageBytes !== null && $this->getErrorOutput()->isVerbose()) {
93+
if ($this->getErrorOutput()->isVerbose()) {
9494
$this->getErrorOutput()->writeLineFormatted(sprintf(
95-
'Used memory: %s',
96-
BytesHelper::bytes(max(memory_get_peak_usage(true), $peakMemoryUsageBytes)),
95+
'Elapsed time: %s',
96+
$this->formatDuration((int) round(microtime(true) - $analysisStartTime)),
9797
));
9898
}
9999

100-
if ($this->getErrorOutput()->isDebug()) {
100+
if ($peakMemoryUsageBytes !== null && $this->getErrorOutput()->isVerbose()) {
101101
$this->getErrorOutput()->writeLineFormatted(sprintf(
102-
'Analysis time: %s',
103-
$this->formatDuration((int) round(microtime(true) - $analysisStartTime)),
102+
'Used memory: %s',
103+
BytesHelper::bytes(max(memory_get_peak_usage(true), $peakMemoryUsageBytes)),
104104
));
105105
}
106106

0 commit comments

Comments
 (0)