Re: in php query execution time

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



what do u think using :

////
function getmicrotime(){
    list($usec, $sec) = explode(" ",microtime());
    return ((float)$usec + (float)$sec);
    }

$time_start = getmicrotime();

for ($i=0; $i < 1000000; $i++)
{
$sql="somting ";
mysql_query($sql);
}

$time_end = getmicrotime();
$time = $time_end - $time_start;

echo "Query Time: $time seconds";
/////////////////

give me ur comment
nabil




"Ignatius Reilly" <ignatius.reilly@free.fr> wrote in message
039501c31e04$c4f8fba0$0100a8c0@server">news:039501c31e04$c4f8fba0$0100a8c0@server...
> I don't think it is possible to do this with the PHP MySQL API.
>
> What you can do is enclose your query call with two timestamps, and
compute
> the difference. You won't measure the same thing, but it can be useful
> still.
>
> Ignatius
> ____________________________________________
> ----- Original Message -----
> From: "nabil" <nabil.attar@aws-syria.com>
> To: <php-db@lists.php.net>
> Sent: Monday, May 19, 2003 2:12 PM
> Subject:  in php query execution time
>
>
> > I need to get the query execution time like the one we get in the shell
> > (Query OK, 1 row affected (0.00 sec)) on my php page!!!
> >
> > Please advise
> >
> >
> >
> > --
> > PHP Database Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
>



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


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux