Home  >  Article  >  Backend Development  >  Implementation code for PHP scheduled tasks and scheduled execution tasks_PHP Tutorial

Implementation code for PHP scheduled tasks and scheduled execution tasks_PHP Tutorial

WBOY
WBOYOriginal
2016-07-21 15:30:00938browse

I don’t know if the performance of the program will be greatly affected!

Copy code The code is as follows:

ignore_user_abort();//Close the browser, and the PHP script can continue to execute.
set_time_limit(0);// Through set_time_limit(0), the program can be executed without limit
$interval=60*30;// Run every half hour
do{
// Here is the code you want to execute
sleep($interval); // Wait for 5 minutes
}while(true);

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/323272.htmlTechArticleI don’t know if the performance of the program will be greatly affected! Copy the code. The code is as follows: ignore_user_abort();//Close the browser, and the PHP script can continue to execute. set_time_limit(0);//By set...
Statement:
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