Process Time in Web pages

Discussion in 'Apache' started by jluis100, Apr 15, 2008.

  1. #1
    Hi all,

    i have been reading some related information about Apache web server but i have not found anything... Well, i would like to show in my web page the process time that Apache needs to serve this page.

    Does anybody know how can i do that?

    Thanks in advance,

    regards,
    Juan Luis
     
    jluis100, Apr 15, 2008 IP
  2. Ladadadada

    Ladadadada Peon

    Messages:
    382
    Likes Received:
    36
    Best Answers:
    0
    Trophy Points:
    0
    #2
    This is more of a PHP thing than an Apache thing but the simplest way is to add something like this at the top of your script:

    $start_time = microtime(TRUE);
    PHP:
    and this near the bottom:

    $end_time = microtime(TRUE);
    $total_time = $end_time - $start_time;
    echo ("This page generated in ".round($total_time, 2)." seconds.");
    PHP:
     
    Ladadadada, Apr 15, 2008 IP