PaXo Posted August 20, 2008 Share Posted August 20, 2008 is it possible, to have a timer in PHP, say i want it to excecute a command but not for lets say 2 seconds, is it possible to make it wait 2 seconds and then excecute it? regards Quote Link to comment Share on other sites More sharing options...
obsidian Posted August 20, 2008 Share Posted August 20, 2008 Check out the sleep() method. This will cause your script to delay continuing execution for X number of seconds, but it literally freezes the execution of the entire script that long, so it will appear that nothing is happening. This may not be the action you are seeking, so feel free to clarify further. Quote Link to comment Share on other sites More sharing options...
PaXo Posted August 20, 2008 Author Share Posted August 20, 2008 well what im doing is making a IRC bot through PHP and i want it so when someone types a command, it wont say it straight away, it will wait a couple of seconds and then say it to prevent spam regards Quote Link to comment Share on other sites More sharing options...
Minase Posted August 20, 2008 Share Posted August 20, 2008 give a part of script / script to see what you want to do and yes it is possible to do it Quote Link to comment Share on other sites More sharing options...
PaXo Posted August 20, 2008 Author Share Posted August 20, 2008 i dont understand what you mean? also how do i do it sorry, still learning the odd bits and bobs regards Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.