A simple timer: <? $length = 10; $timestart = time();
for (;;) { if (time() = $timestart + 10) { // go } } ?> Also, you should look at the PEAR::Net_SmartIRC framework (it has timers already). It's a fantastic framework, and there's really no point in re-writing the textbook. http://pear.php.net/package/Net_SmartIRC -- aidan "Nobody" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hello, > > I'm writing a php irc bot. I've come up to the situation where I need a > timer for processing different data in a "special" way. I've searched the > archive of the list but I didn't found nothing helpful (I can't use > JavaScript here, neither cron). > If I use for(;;) or sleep(); the whole script stops (php is not > multithread:(). Eventually I've come up with some ideas about ticks, but > didn't get to finished it my head. So, any ideas? > > And is php5 going to be multithreaded? If not, when?:) > > -- > best wishes, > Strahil Minev, > http://sourceforge.net/users/phuncky/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php