How do i run a php script every second?

后端 未结 5 1864
醉话见心
醉话见心 2020-12-20 08:51

I am currently writing a online game. Now I have to check if an event happen (checking timestamp in database) and depending on that execute some actions. I have to check for

5条回答
  •  不知归路
    2020-12-20 09:48

    You should probably run the script once, and use a loop with delay to accomplish your desired timing. The side benefit is that this is more efficient, and you would only have to open resources (ie, databases) once.

提交回复
热议问题