-
Notifications
You must be signed in to change notification settings - Fork 48
process output
Inhere edited this page Jan 10, 2019
·
1 revision
使用 Show::dynamicTxt()/$output->dynamicTxt()
show-progress-txt
使用 Show::progressTxt()/$output->progressTxt()
show-progress-txt
使用 Show::progressBar()/$output->progressBar()
public static function progressBar(int $total, array $opts = [])
示例代码:
$total = 120; $bar = Show::progressBar($total, [ 'msg' => 'Msg Text', 'doneChar' => '#'// ♥ ■しかく ☺ ☻ = # Windows 环境下不要使用特殊字符,否则会乱码 ]); echo "Progress:\n"; $i = 0; while ($i <= $total) { $bar->send(1);// 发送步进长度,通常是 1 usleep(50000); $i++; }
show-progress-bar