Home > Backend Development > PHP Tutorial > 可否控制每次循环的时间

可否控制每次循环的时间

WBOY
Release: 2016-06-13 12:07:20
Original
1066 people have browsed it

能否控制每次循环的时间
有些网站的API有提交查询次数的限制,比如:每分钟一次,一次最多100个数据。

如果我需要查1000个数据,那就要10分钟,循环的话,请问怎么控制这个时间呢???
------解决思路----------------------
循環體內加個sleep(秒數);實現。
例如:
for($i=0; $i   // do sth
   sleep(60);
}

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template