PHP is the implementation code for scheduling and timing tasks

  • 2020-05-05 10:58:45
  • OfStack

I do not know the performance of the program will affect very much!
 
ignore_user_abort();// Close the browser, PHP The script can also continue to execute . 
set_time_limit(0);//  through set_time_limit(0) Allows the program to execute indefinitely  
$interval=60*30;//  It runs every half hour  
do{ 
// Here's the code you want to execute  
sleep($interval);//  Waiting for the 5 minutes  
}while(true); 

Related articles: