Forums

Is there a page render/db queries plugin? (2 posts)

  1. digitaltoast
    Member
    Posted 4 years ago #

    I'm having..."issues"...with my web host who say their server is running fine. I'm seeing page load times of over 30 seconds.

    Is there some plugin which will either display the page render/parse time and/or database queries at the foot of the page and/or log them to a file for each page looked at?

    I'm not talking about anything network related, I'm talking about a microtime start in the header, and end in the footer, so we get a real idea of how long the page took to generate. Thanks!

  2. digitaltoast
    Member
    Posted 4 years ago #

    I have a partial solution: Right at the top of index.html, put

    <?php
    $time = microtime();
    $time = explode(' ', $time);
    $time = $time[1] + $time[0];
    $begintime = $time;
    ?>

    and right at the bottom, put

    <?php
    $time = microtime();
    $time = explode(" ", $time);
    $time = $time[1] + $time[0];
    $endtime = $time;
    $totaltime = ($endtime - $begintime);
    echo 'PHP parsed this page in ' .$totaltime. ' seconds.';
    ?>

    This only does it for the index page - is there a place I can put this so it works for pages, posts, wpg2 etc?

    And it would be good if I could write it to a file. Thanks!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags