Jump to content

[SOLVED] Probably a Noob question


ballhogjoni

Recommended Posts

Like this?

$i = 1;
foreach( $array as $item ){
   if($i == 100)
      sleep(1);
   $i++;
}

 

That should cause it to sleep 1 second for every 100 loops, incremented by $i.

 

Yea thats what I want but lets say you have 1000 keys in your array, but you don't know that because that array is generated dynamically in this case you would want the loop to sleep for a total of 10 seconds.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.