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 Link to comment https://forums.phpfreaks.com/topic/120531-php-timer/ 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. Link to comment https://forums.phpfreaks.com/topic/120531-php-timer/#findComment-621101 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 Link to comment https://forums.phpfreaks.com/topic/120531-php-timer/#findComment-621110 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 Link to comment https://forums.phpfreaks.com/topic/120531-php-timer/#findComment-621127 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 Link to comment https://forums.phpfreaks.com/topic/120531-php-timer/#findComment-621129 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.