Php,等待5秒后再执行一个动作

use*_*690 34 php

我有一个.php脚本,用于创建我的产品列表.我在共享主机上,所以我不能做很多查询,否则我会得到一个空白页面.

这就是我现在使用我的脚本的方式:

script.php?start=0&end=500&indexOfFile=0  ->> make a product0.txt file with first 500 products

script.php?start=501&end=1000&indexOfFile=1 ->> product1.txt file with another 500 products

script.php?start=1001&end=1500&indexOfFile=2 ->> product2.txt file with last 500 products
Run Code Online (Sandbox Code Playgroud)

如何修改脚本以便自动生成所有这些文件,以便我不必每次手动更改链接?

我想点击一个按钮来执行此操作:

product0.txt使用前500个产品制作文件

等5秒

product1.txt与另外500个产品一起制作文件

等5秒

product2.txt使用最近500个产品制作文件

Bri*_*ian 60

使用:

sleep(NUMBER_OF_SECONDS);
Run Code Online (Sandbox Code Playgroud)


gen*_*sis 28

在开始你的行动之前,请使用

 sleep(5);
Run Code Online (Sandbox Code Playgroud)


Law*_*one 9

要么:

usleep(NUMBER_OF_MICRO_SECONDS);
Run Code Online (Sandbox Code Playgroud)