thibī wrote:
Quote:
Mikhail Kovalev wrote:
Quote:
>I'm using set_time_limit() to set maximum execution time. Is there a
>way to check how much time is left at any time during the execution
>itself?
>
Use time() or microtime() at the beginning of the script and store the
value. Later, call it again and substract the start time, you'll get the
elapsed time. Another substraction of the time limit by the elapsed time
will give you the remaining time.
>
-thibī
>
Not true.
set_time_limit is the limit for execution time. time() or microtime()
is real time. A huge difference.
For instance - say you have a time limit of 30 seconds. One second into
your script, a high priority process gets invoked and runs for two minutes.
You still have about 29 seconds left left on your script, but the time()
or microtime() function says you're 1 minute, 31 seconds over.
An extreme example, I know. But it gets the point across.
So no, there is no way to tell how much time is left.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================