1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Source Speed Test Script PHP

Discussion in 'PHP' started by inrev, Dec 5, 2009.

  1. #1
    A PHP script for everyone to put on a local server for speed testing between broadband connections. Optionally saves results into a MySQL database for viewing by an administrator.

    You can download script here
    Megaupload.com Size : File size: 3.7 MB
    http://www.megaupload.com/?d=8T79HEDC
    Code (markup):
    Alternative link mirror
    
    http://www.easy-share.com/1908636464/speedtest_net_TenThousanddolarGrandscript_.zip
    
    Code (markup):
    Have a nice download all of free and not null so just download and install on your website.

    Do not forget to say Thanks or give me Good Reputation for your thank you full for this scripts :)
     
    inrev, Dec 5, 2009 IP
  2. inrev

    inrev Peon

    Messages:
    60
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    alternative you can use this scripts

    Put the following code at the very beginning of your PHP page.

    <?
    # Page Load Test Script Share by inrev teamz
    $load_time = microtime();
    $load_time = explode(' ',$load_time);
    $load_time = $load_time[1] + $load_time[0];
    $page_start = $load_time;
    
    ?>
    PHP:
    Now put the folowing code at the bottom of your page. I suggest you put it just right before the </body></html> TAGS..


    <?
    $load_time = microtime();
    $load_time = explode(' ',$load_time);
    $load_time = $load_time[1] + $load_time[0];
    $page_end = $load_time;
    $final_time = ($page_end - $page_start);
    $page_load_time = number_format($final_time, 4, '.', '');
    echo("Page generated in " . $page_load_time . " seconds");
    
    ?>
    PHP:
    That's it. Load you page and you will see a message at the bottom of the page telling you how long it takes for your web page to load. Look at the bottom of you page where it says: Page generated in xx.xx seconds
     
    inrev, Dec 5, 2009 IP
  3. Gray Fox

    Gray Fox Well-Known Member

    Messages:
    196
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    130
    #3
    Shortened version of the second script:
    
    echo "Page generated in ". number_format(microtime(true) - $_SERVER['REQUEST_TIME']) ." seconds";
    
    PHP:
     
    Gray Fox, Dec 6, 2009 IP
    EricBruggema likes this.
  4. michael222

    michael222 Peon

    Messages:
    1
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Hi, sorry just new to the forum and found this on a Google search :D

    Only 3 steps to place new script for php, and please back up your files before you test this new code.

    On index page in the HEAD place this code

    <script type="text/javascript">
    var d = new Date();
    var starttime = d.getTime(); //Get the start time
    </script>

    Still on the index page place this code just at the bottom before the BODY tag

    <script type="text/javascript">
    var d2 = new Date();
    var endtime = d2.getTime(); //Get the end time
    //Find the difference between the start and end times
    var totaltime = (endtime - starttime)/1000;
    //Round 2 decimal places
    var result = Math.round(totaltime*100)/100;
    //Output results to a "P" element
    document.getElementById("loadtime").innerHTML = "Loading time: "+ result +" sec(s)";
    </script>

    Close and upload the new index page to the server

    The last piece of code you can place anywhere on the web site on any php page I have done in the hearder

    <p id="loadtime" >Loading...</p>

    Upload and your done

    Can be seen working on Qtellfreeclassifiedads top right

    Enjoy

    Michael :D
     
    michael222, Jun 4, 2012 IP