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
$total_time = 0; $start_time = microtime(true); while($total_time < 60) { //DoSomethingHere; echo $total_time."\n"; //sleep(5); $total_time = microtime(true) - $start_time ; }
add this in crontab to run every minute.