set_time_limit uses CPU time, not wall clock time.
If you want a script to run for only 100 seconds, here is one (crude)
way to modify sample.php:
1. At the start of the script, record start time:
$GLOBALS['start_time']=time();
2. In enqueueStatus():
if( (time() - $GLOBALS['start_time']) >100)exit;
(NB. if your script is not receiving much data, it will stop when it
gets the first tweet after having been running for 100 seconds.)
A few ways to make it less crude:
* Use a class var, not a global;
* Consider doing the check in statusUpdate() (or heartbeat()) (though
that only allows you to stop the script once/minute, not after a precise
number of seconds);
* Throw an exception, instead of using exit.
Darren
--
Darren Cook, Software Researcher/Developer
http://dcook.org/work/ (About me and my work)
http://dcook.org/blogs.html (My blogs and articles)