PHP cURL multi_exec delay between requests

后端 未结 4 1394

If I run a standard cURL_multi_exec function (example below), I get all cURL handles requested at once. I would like to put a delay of 100ms between each request, is there a

4条回答
  •  情话喂你
    2021-01-19 06:26

    Yes, this is possible. If you use the ParallelCurl library, you can much more easily add your 100ms delay with usleep(), as you can make a separate request to be added to the download queue.

    for ($urls as $url) {
        $pcurl->startRequest($url);
        usleep(100000);
    }
    

提交回复
热议问题