SitePoint Sponsor

User Tag List

Results 1 to 6 of 6

Thread: Time

  1. #1
    Hi there! Owen's Avatar
    Join Date
    Jan 2000
    Location
    CA
    Posts
    1,165
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How long is the query time?

    Hello everyone! I'm working with a SQL database and want to impress my visitors with how fast the queries are. Does anyone know how to fetch that information? I'm talking about the time elaped that is shown right after you do a action from the command prompt. It's always something small like 0.10 seconds or something like that.

    Thanks
    Owen
    Last edited by Owen; Mar 15, 2001 at 02:11.

  2. #2
    Hi there! Owen's Avatar
    Join Date
    Jan 2000
    Location
    CA
    Posts
    1,165
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Anyone??

    Owen

  3. #3
    ********* Callithumpian silver trophy freakysid's Avatar
    Join Date
    Jun 2000
    Location
    Sydney, Australia
    Posts
    3,798
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by Owen
    ... want to impress my visitors with how fast the queries are.
    LOL.

    I just had a look through the php mysql function documentation. Didn't see anything that would retrieve this info.

    However, I guess you can do this...


    $startTime = getmicrotime();
    mysql_query(...);
    $endTime = getmicrotime();

    $queryTime = $endTime - $startTime; // in milliseconds

  4. #4
    Hi there! Owen's Avatar
    Join Date
    Jan 2000
    Location
    CA
    Posts
    1,165
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yah, that's what I've seen... but you CAN do the benchmark program, but that seems inefficient since you have to run it twice.

    Owen

  5. #5
    ********* Callithumpian silver trophy freakysid's Avatar
    Join Date
    Jun 2000
    Location
    Sydney, Australia
    Posts
    3,798
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    BTW - your site is very fast! Where do you host it? Dedicated/colo or shared server?

  6. #6
    Hi there! Owen's Avatar
    Join Date
    Jan 2000
    Location
    CA
    Posts
    1,165
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Nah, it's just having a good day. It's hosted on a regular account at OLM. (They're pretty good, if you're looking, though their control panel and support sucks.)

    Owen


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
  •