Jump to content

Archived

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

karthikeyan_coder

delay an execution of single line...

Recommended Posts

i need to delay a single line's execution. let us say...

2: for($loop=1;$loop<=100;$loop++)
3: {
4: mail();
5: }

i need to delay execution of mail(); as 1sec.... this script must finish 100 emails after 100secs.... 1 sec delay for each mails.

how its possible??


Share this post


Link to post
Share on other sites
[code]<?php

for( $loop=1; $loop <= 100; $loop++ )
{
      mail();
      sleep( 1 ); // delays for 1 seconf ;)
}

?>[/code]

have fun :)

Share this post


Link to post
Share on other sites
[quote author=mrwhale link=topic=99172.msg390436#msg390436 date=1151835948]
[code]<?php

for( $loop=1; $loop <= 100; $loop++ )
{
      mail();
      sleep( 1 ); // delays for 1 seconf ;)
}

?>[/code]

have fun :)
[/quote]

Thanks working fine :)

Share this post


Link to post
Share on other sites

×

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.