SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Guru
    Join Date
    Mar 2004
    Posts
    639
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How to get time of SQL query?

    Hello,

    What is the easiest way to know how much time server needs to run SQL query?

  2. #2
    SitePoint Guru brent5392's Avatar
    Join Date
    Dec 2005
    Location
    Australia
    Posts
    636
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Use microtime.

    http://au.php.net/microtime

    Get the time before the query, get the time after. Subtract the first time from the second.
    PHP | MySQL | (X)HTML | CSS

  3. #3
    SitePoint Guru
    Join Date
    Mar 2004
    Posts
    639
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by brent5392 View Post
    Use microtime.

    http://au.php.net/microtime

    Get the time before the query, get the time after. Subtract the first time from the second.
    Thanks. It works perfectly.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •