Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Nov 2002
    Posts
    37
    Thanks
    0
    Thanked 0 Times in 0 Posts

    help with the "page creation time"

    im trying to figureout what method is faster while i make the scripts.
    to do that i need to know how long it took to complete the script.
    can anyone tell me how to do that?

    thx in advanced.

  • #2
    Senior Coder
    Join Date
    Jun 2002
    Location
    near Oswestry
    Posts
    4,508
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I've got a thing that times how long a page takes to load, from request to completion; it's a broad knife but it should show you if x feature makes a big difference - http://www.brothercake.com/scripts/loadtimer.php

  • #3
    New Coder
    Join Date
    Nov 2002
    Posts
    37
    Thanks
    0
    Thanked 0 Times in 0 Posts
    here it is

    PHP Code:
    <?php
    //script by Afrim S. <afrimi22@yahoo.com>


    //loading time function
    $time_start getmicrotime();

    function 
    getmicrotime(){ 
        list(
    $usec$sec) = explode(" ",microtime()); 
        return ((float)
    $usec + (float)$sec); 
        } 
    //end of loading time function


    //YOUR CODE GOES HERE




    //final code for Loading time.  DO NOT DELETE
    $time_end getmicrotime();
    $time $time_end $time_start;
    echo 
    "Page generated in ".number_format($time,4)." seconds";


    ?>
    brothercake, thanks for that link.


  •  

    Posting Permissions

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