script for dsl speed

script for dsl speed

iam trying to code a dsl speed report. But it delivers false results for the dsl-speed. i think it's because of the script time which increase because of jquery. Maybe anyone have suggestions:

//MESSUNG1
   time      = new Date();
   starttime = time.getTime();

               
   $("#ladefeld").load("http://domain.de/functions/randomstring.php?length=200000",
                  
   function (responseText, textStatus, XMLHttpRequest) {
      if (textStatus == "success") {
         // all good!
         time          = new Date();
         endtime       = time.getTime();

         if (endtime == starttime){downloadtime = 0}
         else {downloadtime = (endtime - starttime)/1000;}

         kbytes_of_data = 200;
         linespeed     = kbytes_of_data/downloadtime;
         kbps          = (Math.round((linespeed*8)*10*1.024))/10;
}
});


Any suggestions? How would you realize that script? Thanks a lot

deblin
    • Topic Participants

    • kmate