I need to implement a feature, in which a certain code runs several times after a time interval.
For example, read files made available by the API every 20 minutes. I tried something of a genre, but I have not tried it, I just want to have an easy and sure way to do it.
while(true)
{
// Executa o codigo aqui;
usleep(1200);
}
Does PHP have some method for scheduling tasks? What would be the mechanism to cancel loop , if the above idea is valid?