note 124381 added to function.set-time-limit

From: Date: Mon, 11 Nov 2019 07:05:52 +0000
Subject: note 124381 added to function.set-time-limit
Groups: php.notes 
Request: Send a blank email to php-notes+get-213035@lists.php.net to get a copy of this message
if you want to check how much time remains, this should work (at least on Windows, on non-Windows platforms, i'm not sure) $seconds_remaining_until_termination = ini_get('max_execution_time') === "0" ? null : ((int)ini_get('max_execution_time'))-(microtime(true)-$_SERVER['REQUEST_TIME_FLOAT']); gives you number of seconds until the script will be terminated due to the time limit. (tested on Windows 7 X64 SP1 with PHP 7.3.7) - or gives you null if there is no time limit. ---- Server IP: 208.43.231.9 Probable Submitter: 185.85.3.168 (proxied: 46.46.192.207) ---- Manual Page -- http://php.net/manual/en/function.set-time-limit.php Edit -- https://master.php.net/note/edit/124381 Del: integrated -- https://master.php.net/note/delete/124381/integrated Del: useless -- https://master.php.net/note/delete/124381/useless Del: bad code -- https://master.php.net/note/delete/124381/bad+code Del: spam -- https://master.php.net/note/delete/124381/spam Del: non-english -- https://master.php.net/note/delete/124381/non-english Del: in docs -- https://master.php.net/note/delete/124381/in+docs Del: other reasons-- https://master.php.net/note/delete/124381 Reject -- https://master.php.net/note/reject/124381 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#213035) next »