Re: How to get cpu consumption of a php script
| From: | Richard Quadling | Date: | Mon, 17 Jan 2011 11:20:38 +0000 |
| Subject: | Re: How to get cpu consumption of a php script | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-310823@lists.php.net to get a copy of this message | ||
On 17 January 2011 10:58, Camilo Sperberg <unreal4u@gmail.com> wrote:
> Please take into account that lighttpd does have some random high cpu-consumption problems, it
> could be that also. Give nginx a try instead.
>
> Also: microtime by itself isn't enough, sum time() to it because if a script lasts more
> than 1 second you can end up with negative total time, microtime doesn't have a seconds
> counter, only microseconds.
http://www.php.net/manual/en/function.microtime.php
: Return current
Unix timestamp with microseconds
Hmm. I'm guessing it does.
[2011/01/17 11:16:06] [Z:\] [\\richardquadling\scratch$ ] >php -r
"echo microtime(true);"
1295263156.1895
Oh yeah!
--
Richard Quadling
Twitter : EE : Zend
@RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY