Re: Sleep Function
| From: | Andrei Zmievski | Date: | Mon, 12 Mar 2001 14:43:00 +0000 |
| Subject: | Re: Sleep Function | ||
| References: | 1 | Groups: | php.gtk |
| Request: | Send a blank email to php-gtk+get-700@lists.php.net to get a copy of this message | ||
Make sure you do set_time_limit(0).
On Mon, 12 Mar 2001, Josh Seward wrote:
> I have been having tourble with boht the sleep and usleep function. I can only get them to
> 40 sec and then they will cut off. This is even true with the micro seconds in the usleep function.
>
> Here is my code:
>
> do{
> $hour = date("G");
> $minute = date("i");
> $sec = date("s");
> print "$hour:$minute:$sec\n";
> usleep(100); // or us sleep(1);
> }while($minute != "00");
>
> This will stop on the 40th sec. Its not the 40th loop becuase usleep loops hundreds of
> times but only quite on the 40th second.
>
> I am trying to set up a program to run every hour and this loop finds the hour on the hour
> then continues to run.Incase someone starts the script say at 7:30. It will wait till 8:00 to run
> the rest of the script. If there is a better way to do this please tell!!!!
>
> Thanks,
>
> Josh Seward
> js389599@ohiou.edu
>
>
-Andrei
Give a man a fish; you have fed him for today. Teach a man to use
the Net and he won't bother you for weeks.
-Author unknown