#!/usr/bin/perl # ############################################## # BanderDyn ############################################## # Simple script for measuring download # speed, with some dynamical ability # to end up as soon as 10s are crossed. # # It's time precision is 1s - # we only relay on system time ability # and are not using require 'sys/syscall.ph'; # http://www.perldoc.com/perl5.8.0/pod/perlfaq8.html # # Bander, maintenance: Adam Pribyl, covex@ahoj.fsik.cvut.cz # Dyn: Petr Simandl, www.simandl.cz ############################################### print "Content-type: text/html\n\n"; print "
\n"; # nocache! $kb = 1024; @nkbp = (10,20,70,150,300,218); $nkb = 0; $lnkbp = $#nkbp; @pism = ("aa","bb","cc","dd","ee","ff"); $svrtimeout = 30; # httpd server timeout in seconds $testtime = 10; # maximum test time $lospd = $nkbp[0]/$svrtimeout; #print "";
$time = ($tm2-$tm1);
printf "Sent $nkb kiB from $server to $adresa in $time seconds
\n";
print "Approximate download bandwidth speed of your connection is: ";
# to not divide accidentaly by zero we accept inacurrancy of 0.001s
$speed = $nkb*$kb/($time+0.001);
$speedkb = $speed/$kb;
$speedkbps = 8*$speed/$kb;
printf "%.2f B/s = %.2f kiB/s = %.2f kib/s\n", $speed, $speedkb, $speedkbps;
$date = `date`;
print "
$date\n
";
print "BanderDyn speed test\n";
#print "
![]() ![]() |
banderdyn |
Subversion Repositories: |
Line No. | Rev | Author | Line |
---|