src/Process.php
public function wait($block = true, $sleep = 100000)
    {
        while (true) {
            if ($this->isRunning() === false) {
                return;
            }
            if (!$block) {
                break;
            }
            usleep($sleep);
        }
    }
public function wait($block = true, $sleep = 100000)
    {
        while (true) {
            if ($this->isRunning() === false) {
                return;
            }
            if (!$block) {
                break;
            }
            usleep($sleep);
        }
    }
public function wait ( $ block = true , $ sleep = 100000 ) { while ( true ) { if ( $ this -> isRunning ( ) === false ) { return ; } if ( ! $ block ) { break ; } usleep ( $ sleep ) ; } }
waiting for the sub process exit

@param bool|true $block if block the process
@param int $sleep default 0.1s check sub process status
every $sleep milliseconds.
waiting for the sub process exit