| Welcome to WebmasterWorld Guest from 18.104.22.168 |
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
|Pubcon Platinum Sponsor 2014|
|Problem with maximum execution time|
| 9:01 pm on Aug 27, 2007 (gmt 0)|
I need to run a script which will take several minutes to complete, but the max execution time is 30 seconds and I cannot change that value.
Is there some way to detect the elapsed execution time of a script, in order to suspend it automatically and prevent the timeout?
Thanks in advance!
| 2:47 am on Aug 28, 2007 (gmt 0)|
set_time_limit(0); removes the limitation altogether
set_time_limit(X); sets the time limit to X
To detect run-time, use something like this:
The 25 allows 5 seconds spare, you may wish to cut it finer depending on how fast your loop runs.
| 6:01 pm on Aug 28, 2007 (gmt 0)|
Thanks, I'll try that.
All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved