public function handle()
{
//
$output = new ConsoleOutput();
$progressBar = new ProgressBar($output, 1000);
$progressBar->setFormat("預計需要時間 %elapsed:6s%/%estimated:-6s% 記憶體消耗: %memory:6s%\n%current%/%max% [%bar%] %percent:3s%%");
foreach (range(2, 1000) as $_) {
usleep(1000);
$progressBar->advance();
}
$progressBar->finish();
echo "\n";
}
輸出多個進度條:
$progressBar->start();
print "\n";
$progressBar->start();
中間需要列印一個換行符
本作品採用《CC 協議》,轉載必須註明作者和本文連結