Re: Getting MySQL Query Times.
| From: | Andrey Hristov | Date: | Thu, 23 Aug 2001 17:27:00 +0000 |
| Subject: | Re: Getting MySQL Query Times. | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-64144@lists.php.net to get a copy of this message | ||
$this->starttime=explode(' ',microtime());
// query.....
$this->endtime=explode(' ',microtime());
$this->starttime=$this->starttime[1]+$this->starttime[0];
$this->endtime=$this->endtime[1]+$this->endtime[0];
$this->parse_time=$this->endtime-$this->starttime;
I've copied that from a class member but the idea is clear;
Andrey Hristov
IcyGEN Corporation
http://www.icygen.com
99%
----- Original Message -----
From: "Nathan Cook" <security@pcsedu.com>
To: <php-general@lists.php.net>; "Gabe da Silveira" <jiblet@visi.com>
Sent: Thursday, August 23, 2001 7:57 PM
Subject: Re: [PHP] Getting MySQL Query Times.
> IMO, you are better off printing microtime
> [http://www.php.net/manual/en/function.microtime.php] before and after the
> query, and after you loop through it. This will give you a better idea of
where
> the hangups may be. You may also want to sprinkle mircotimes throughout
your
> code to get a good idea of processing time.
>
> Nathan Cook
> ncook@pcsedu.com
> ----- Original Message -----
> From: "Gabe da Silveira" <jiblet@visi.com>
> To: <php-general@lists.php.net>
> Sent: Thursday, August 23, 2001 10:22 AM
> Subject: [PHP] Getting MySQL Query Times.
>
>
> > I was looking thru the mysql functions, and there doesn't seem to be one
> > that gives you the amount of time a query takes. Is there anyway to get
> > this information (since it gives it to you when you type queries
> > directly into the mysql shell client)? A script of mine is starting to
> > get fairly slow (2-3 seconds for page to process) and I want to be able
> > to log the query speeds so I can see if there's a database bottleneck or
> > if my code is just kludgy.
> >
> > --
> > __________________________________
> > Gabe da Silveira, Web Designer
> > Twin Cities Student Unions
> > University of Minnesota
> > http://www.coffman.umn.edu
> >
> > wFone: (612)624-7270
> > eMail: jiblet@visi.com
> > hPage: http://www.visi.com/~jiblet
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> > For additional commands, e-mail: php-general-help@lists.php.net
> > To contact the list administrators, e-mail: php-list-admin@lists.php.net
> >
> >
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>
>