m002.p
01-16-2009, 09:49 PM
Hello everyone.
I have developed a rather complex script to query a gameserver which also makes checks on players within. However the issue I am having difficulty with is running the PHP script every X seconds.
I know of a simple way which works but doesnt seem too accurate when executing it for me.
$overall_time = 0;
while ($overall_time < 60) { $overall_time +10= ; sleep(10);
// The script
}
So I want to ask those knowledgable coders out there the best way to run a script say every 5-10 seconds using possibly a 1 min CRON kick start?
Any help appreciated.
Matt
I have developed a rather complex script to query a gameserver which also makes checks on players within. However the issue I am having difficulty with is running the PHP script every X seconds.
I know of a simple way which works but doesnt seem too accurate when executing it for me.
$overall_time = 0;
while ($overall_time < 60) { $overall_time +10= ; sleep(10);
// The script
}
So I want to ask those knowledgable coders out there the best way to run a script say every 5-10 seconds using possibly a 1 min CRON kick start?
Any help appreciated.
Matt