You are here: set_time_limit behavior « PHP « IT news, forums, messages
set_time_limit behavior

Posted by michael on 10/21/41 11:26

Hi,

I am trying to figure out why a script that is set to time out after 30
seconds will run indefinitely. For example,

set_time_limit(30);
echo ini_get('max_execution_time'), "<hr />";
echo date("H:i:s"), "<hr />";
for ($i = 0; $i < 100; $i++)
{
sleep(10);
echo date("H:i:s"),"<hr />";
flush();
}
echo "Done!";

result:

30
------------------------------------------------------------------------
13:54:09
------------------------------------------------------------------------
.....
------------------------------------------------------------------------
14:10:50
------------------------------------------------------------------------
Done!


As you can see, this script ran for over 14 minutes. I have read that
max_execution_time is bound to CPU time, and I am not sure how this
translates into being able to effectively use this parameter.

Comments / insight extremely appreciated.

Michael

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация