\Inhere\Console\Component\ProgressCounterText

Class CounterText

...

Summary

Methods
Properties
Constants
getSpeed()
setSpeed()
display()
gen()
No public properties found
No constants found
No protected methods found
$speed
N/A
No private methods found
No private properties found
N/A

Properties

$speed

$speed : integer

Type

integer — Speed value. allow 1 - 10

Methods

getSpeed()

getSpeed() : integer

Returns

integer

setSpeed()

setSpeed(integer  $speed) 

Parameters

integer $speed

display()

display() 

gen()

gen(string  $msg, string  $doneMsg = '') : \Generator

与文本进度条相比,没有 total

 $total = 120;
 $ctt = Show::counterTxt('handling ...', 'handled.');
 $this->write('Counter:');
 while ($total - 1) {
     $ctt->send(1);
     usleep(30000);
     $total--;
 }
 // end of the counter.
 $ctt->send(-1);

Parameters

string $msg
string $doneMsg

Returns

\Generator