Is there a set time out equivalent in php?

后端 未结 4 1014
不思量自难忘°
不思量自难忘° 2020-12-20 16:09

Is there a PHP equivalent to setting timeouts in JavaScript?

In JavaScript you can execute code after certain time has elapsed using the set time out function.

4条回答
  •  再見小時候
    2020-12-20 16:50

    PHP is single-threaded, and in general PHP is focused on the HTTP request cycle, so this would be tricky to allow a timeout to run code, potentially after the request is done.

    I can suggest you look into Gearman as a solution to delegate work to other PHP processes.

提交回复
热议问题