FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » time consuming loop
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: time consuming loop [message #170876 is a reply to message #170865] Sat, 04 December 2010 14:02 Go to previous messageGo to previous message
Jerry Stuckle is currently offline  Jerry Stuckle
Messages: 2598
Registered: September 2010
Karma:
Senior Member
On 12/4/2010 2:39 AM, Paul Fredlein wrote:
> Hi,
>
> If I use a loop that's too time consuming the browser will complain. Is
> there a callback or threads or something I can use and only do a small
> number each time instead of the whole lot at once?
>
> for(short i = 0; i< LONG_INT; i++)
> {
> doSomething();
> }
>
> Thanks,
>
> Paul

Not in PHP. The browser will time out after whatever setting the
browser has. And this won't be until the PHP code on the server has
finished.

You could get around this with AJAX (see comp.lang.javascript), but the
question is - what are you doing which takes this long? People are not
going to wait very long for a web page to load. And if the browser is
timing out, that's way too long.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex(at)attglobal(dot)net
==================
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Demo PHP/Ajax slideshow server crashing
Next Topic: Apache + PHP module segfaults
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Tue Nov 26 16:34:21 GMT 2024

Total time taken to generate the page: 0.03839 seconds