How do i run a php script every second?

后端 未结 5 1862
醉话见心
醉话见心 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:49

    You shouldn't want this :P. No host will accept your cronjob is running every second every minute? You can save the time it runned in a database, and the next time you run it calculate the time between both runs and do the calculations you want. every second is a very bad idea.

提交回复
热议问题