If you have an apache webserver setup you should look into the ab,
apache benchmark suite. This will give you a very good tool to
benchmark your files in its correct environment without altering your
code.

If youre on a windows plattform and cant locate the ab.exe tool
please tell me and I'll email it to you, I remember I spent some time
finding it.

--
--
Kim Steinhaug
----------------------------------------------------------------------
There are 10 types of people when it comes to binary numbers:
those who understand them, and those who don't.
----------------------------------------------------------------------
www.steinhaug.com - www.easywebshop.no - www.webkitpro.com
----------------------------------------------------------------------

"Anguz" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hello,
>
> I have a script I am optimizing and want to compare the before and after
> in speed. So I wrote a few lines to loop this script but I have a
> problem. In the script I'm optimizing there's some function definitions
> and when the script starts the second iteration it throws an error
> because the function already exists. How can I modify my benchmark code
> to make it work? This is what I have:
>
> <?php
> $bench_n = 1000;
> for($bench_i=$bench_n; --$bench_i>=0; ){
> ob_start();
> $bench_time1 = array_sum(explode(' ', microtime()));
> // script start ************************************
>
> // script...
>
> // script end **************************************
> $bench_time0 += array_sum(explode(' ', microtime())) - $bench_time1;
> while(@ob_end_clean());
> }
> echo '<pre>Tot Time: ' , $bench_time0 , '<br />Loops:    ' , $bench_n ,
> '<br />Avg Time: ' , ($bench_time0 / $bench_n) , '</pre>';
> ?>
>
> Thank you very much in advance.
>
> Cristian

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to