程序定时执行的问题

WBOY
Release: 2016-06-23 13:43:59
Original
744 people have browsed it

功能说明:
功能类似于腾讯的 邮箱定时发送功能,比如老师要给学生布置作业,老师在发布作业 的时候可以设定一个发送时间,然后当到达这个时间时,系统自动将此作业发送给学生。


回复讨论(解决方案)

取消那个timeout,就一直执行就行了

程序循环每隔一段时间运行检测时间 当当前时间大于指定时间 运行指定程序并退出

while(1){  if(time()>$time{     function('你的程序');     breakl   }  sleep(10);}
Copy after login

用crontab,php中给服务器添加一个执行队列,时间上精确控制

计划任务 扫面队列 满足条件执行。

使用crontab

http://blog.csdn.net/fdipzone/article/details/7263361

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