Re: [PHP-DEV] Interesting sleep() side-effect From: Dave Walton (walton <email protected>)
Date: 01/27/99

On 27 Jan 99, at 7:51, Rasmus Lerdorf wrote:

> If you run the script again with the sleep() call left
> in, could you time it with a watch and see if it takes exactly 75 seconds
> (assuming $i gets to 70)? I think that is what I am seeing here, but I am
> not sure.

I don't have a watch handy, so I'll just use the computer instead. :)

> It is as if the time spent in the sleep() call does not count.

That's what it looks like. Notice that sleep() time does not count
as user time...

No sleep():
# /usr/bin/time php test.php3
        ..................................................................
        ..............<br>62
        ..................................................................
        ..............<br><br>
<b>Fatal error</b>: Maximum execution time of 30 seconds
exceeded in <b>test.php3</b> on line <b>13</b><br>
        5.13 real 4.94 user 0.01 sys
      1140 maximum resident set size
       393 average shared memory size
       647 average unshared data size
       128 average unshared stack size
        76 page reclaims
         0 page faults
         0 swaps
         0 block input operations
         1 block output operations
         0 messages sent
         0 messages received
         1 signals received
         1 voluntary context switches
       309 involuntary context switches

With sleep():
# /usr/bin/time -l php test.php3
        ..................................................................
        ..............<br>69
        ..................................................................
        ..............<br><br>
<b>Fatal error</b>: Maximum execution time of 30 seconds
exceeded in <b>test.php3</b> on line <b>13</b><br>
       74.85 real 5.43 user 0.01 sys
      1152 maximum resident set size
       397 average shared memory size
       654 average unshared data size
       129 average unshared stack size
        78 page reclaims
         0 page faults
         0 swaps
         0 block input operations
         1 block output operations
         0 messages sent
         0 messages received
        70 signals received
        70 voluntary context switches
       322 involuntary context switches

Dave

----------------------------------------------------------------------
Dave Walton
Webmaster, Postmaster Emusic
walton <email protected> http://www.emusic.com
----------------------------------------------------------------------

--
PHP Development Mailing List   http://www.php.net/
To unsubscribe send an empty message to php-dev-unsubscribe <email protected>
For help: php-dev-help <email protected>