我在使用sleep函数的时候发现, 现在访问页面访问不了 一直显示等待localhost响应
set_time_limit(0); // 执行时间为无限制,php默认执行时间是30秒,可以让程序无限制的执行下去 $interval=120; do{ $sql="select cputotal,updatetime from systemcpu where systemid=$keyid"; $result=mysql_query($sql); $rows=mysql_fetch_array($result); $gettime= (strtotime($rows["updatetime"])-8*60*60)*1000; sleep($interval); }while(true);
do {
........
while(true);
这是死循环,当然要一直等待下去
好的 已经知道了
我试试使用ajax来实现
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号