set_time_limit(秒数):
规定从该句运行时起程序必须在指定秒数内运行结束,超时则程序出错退出.
Max_execution_time:
页面的超时时间,若为0,则永不超时。
测试用例:

 
$time=set_time_limit(1);				//以下所有语句1秒钟执行完
echo $time."\n";
$i=1;
do{ 								//此循环能在1秒钟完成吗?出错退出
    $i=$i+1;
}while($i<=90000000);
echo $i;
$time=set_time_limit(0);				//重新调整设定值
echo $time."\n";

在 php.ini 中的 max_execution_time 变数设定为 0 则不限定最久时间。Set_time_limit函数用来设定该页最久执行时间,若设定值是 30 秒,当执行到该函数时,才开始计算。例如,若内定是30 秒,而在执行到该函数前已执行了 25 秒,而用本函式改为 20 秒,则该页面最长执行时间为 45 秒。

14 Comments

  1. Many thanks to you for sharing these types of wonderful posts. In addition, the optimal travel and medical insurance system can often ease those considerations that come with vacationing abroad. Your medical emergency can rapidly become very expensive and that’s bound to quickly impose a financial stress on the family’s finances. Having in place the ideal travel insurance program prior to setting off is definitely worth the time and effort. Cheers

  2. An impressive share, I just given this onto a colleague who was doing a little analysis on this. And he in fact bought me breakfast because I found it for him.. smile. So let me reword that: Thnx for the treat! But yeah Thnkx for spending the time to discuss this, I feel strongly about it and love reading more on this topic. If possible, as you become expertise, would you mind updating your blog with more details? It is highly helpful for me. Big thumb up for this blog post!

  3. how to increase ejaculate volume naturally food for sperm count increase how to improve sperm quantity increase ejaculate fluid how to make a lot of sperm sperm increase diet how can increase my sperm sperm booster foods increasing sperm count naturally sperm regeneration after ejaculation how to make a bigger load how to build sperm count enhance sperm volume enhance sperm production how to increase the amount of sperm average sperm count in men improve sperm sperm quality and quantity sperm producing amount of sperm in precum vitamins to improve sperm morphology

发表评论

电子邮件地址不会被公开。 必填项已用*标注

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>


*