Re: in php query execution time
| From: | nabil | Date: | Mon, 19 May 2003 13:14:29 +0000 |
| Subject: | Re: in php query execution time | ||
| References: | 1 2 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-27886@lists.php.net to get a copy of this message | ||
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
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: [PHP-DB] 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
> >
> >
>