parent
a4ffda699f
commit
2936dc0e55
|
@ -96,16 +96,11 @@ class ConsoleIO extends BaseIO
|
|||
public function write($messages, $newline = true)
|
||||
{
|
||||
if (null !== $this->startTime) {
|
||||
$messages = (array) $messages;
|
||||
$startTime = $this->startTime;
|
||||
$messages = array_map(function ($message) use ($startTime) {
|
||||
return sprintf(
|
||||
'[%.1fMB/%.2fs] %s',
|
||||
memory_get_usage() / 1024 / 1024,
|
||||
microtime(true) - $startTime,
|
||||
$message
|
||||
);
|
||||
}, $messages);
|
||||
$memoryUsage = memory_get_usage() / 1024 / 1024;
|
||||
$timeSpent = microtime(true) - $this->startTime;
|
||||
$messages = array_map(function ($message) use ($memoryUsage, $timeSpent) {
|
||||
return sprintf('[%.1fMB/%.2fs] %s', $memoryUsage, $timeSpent, $message);
|
||||
}, (array) $messages);
|
||||
}
|
||||
$this->output->write($messages, $newline);
|
||||
$this->lastMessage = join($newline ? "\n" : '', (array) $messages);
|
||||
|
|
Loading…
Reference in New Issue