php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #17013 sleep function doesnt work correctly
Submitted: 2002-05-05 09:06 UTC Modified: 2002-05-05 09:22 UTC
From: jandevries146 at noknok dot nl Assigned:
Status: Not a bug Package: Reproducible crash
PHP Version: 4.2.0 OS: win ME
Private report: No CVE-ID: None
 [2002-05-05 09:06 UTC] jandevries146 at noknok dot nl
The time limit doesnt work correctly 
when PHP sleeps this time IS included when determining the maximum time that the script has been running  


the manual states:
The set_time_limit() function and the configuration directive max_execution_time only affect the execution time of the script itself. Any time spent on activity that happens outside the execution of the script such as system calls using system(), the sleep() function, database queries, etc. is not included when determining the maximum time that the script has been running. 

if you want to reproduce the problem just run this few lines
and you will see it never never echos "after sleep"


<?php
echo "before sleep";
set_time_limit(5);
sleep(6);
echo "after sleep";
?>



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-05-05 09:22 UTC] jan@php.net
please read http://www.php.net/manual/en/function.set-time-limit.php
no bug, no documantation problem -> bogus
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu May 16 11:01:31 2024 UTC