示例#1
0
function test_notify(\cli\Notify $notify, $cycle = 1000000, $sleep = null)
{
    for ($i = 0; $i <= $cycle; $i++) {
        $notify->tick();
        if ($sleep) {
            usleep($sleep);
        }
    }
    $notify->finish();
}
示例#2
0
 /**
  * Forces the current tick count to the total ticks given at instatiation
  * time before passing on to `cli\Notify::finish()`.
  */
 public function finish()
 {
     $this->_current = $this->_total;
     parent::finish();
 }