Home > Backend Development > PHP Tutorial > 关于sleep函数的问题

关于sleep函数的问题

WBOY
Release: 2016-06-23 13:12:47
Original
1277 people have browsed it

我在使用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);	
Copy after login


回复讨论(解决方案)

do {
   ........
while(true);

这是死循环,当然要一直等待下去

好的   已经知道了   
我试试使用ajax来实现

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