sleep
(PHP 3, PHP 4, PHP 5)sleep -- Delay execution
Description
int sleep ( int seconds )
The sleep() function delays program execution for the given number of seconds.
(PHP 3, PHP 4, PHP 5)sleep -- Delay execution
Description
int sleep ( int seconds )
The sleep() function delays program execution for the given number of seconds.
<?php
echo 12312;
sleep(3);
echo 12312;
sleep(2);
echo 1321312;
?>
这样写都是等够6秒,再一下显示出来.
用JS,又如何写呢?
参照一下吧
结合setTimeout()就OK啊~~~ 不过这样请求是不是有点太多了??也可以一次性把数据取出来,再在客户端用setTimeout()控制隔X秒输出一条记录.这样对服务器的压力小,同时能达到你要的效果.