{ $sum = 0; for ($i = 0; $i < 1; $i++) { $this->picArray = array(); $this->mp3Array = array(); $start = $sum; $end = $start + 1000; $sum = $end; $this->start_one($start, $end); } } public function start_one($start, $end) { $now = time(); $this->logger("start {$start}-{$end}: ", $now); $data = $this->read_file($start, $end); $this->write_url($data); $this->logger("ended {$start}-{$end}: ", time() - $now); } } /** * $readPath , * $basePath='/home/pzr/tour' , * $type = 'img', * $logPath='/tmp/tourism.log' ) * @var unknown */ $readPath = '/home/pzr/download/2016-05-08/'; $tourism = new tourism($readPath); $tourism->start_one(0, 1000);