#!/usr/bin/perl # # Adam Pribyl, covex@ahoj.fsik.cvut.cz # Petr Simandl, www.simandl.cz print "Content-type: text/html\n\n"; print "\n"; #nocache! $kb = 1024; $nkba = 20; # size of a transfer test file $nkbb = 50; # size of b transfer test file $nkbc = 100; # size of c transfer test file $nkbd = 300; # size of d transfer test file $nkbe = 500; # size of e transfer test file $svrtimeout = 30; # httpd server timeout in seconds $testtime = 10; #maximum test time $lospd = $nkba/$svrtimeout; print "
\nIf no speed information is given then either your connection is too slow (< $lospd kiB/s) or you are experiencing signal dropouts.
\n"; print "Sending"; $tm1 = time; for ($f = 1; $f <= $nkba; $f++) { print ". "; } $tm2 = time; $nkb = $nkba; print "$nkb"; print "kiB"; if ( ($tm2-$tm1) < $testtime ) { for ($f = 1; $f <= $nkbb; $f++) { print ". "; } $tm2 = time; $nkb = $nkb + $nkbb; print "$nkb"; print "kiB"; } if ( ($tm2-$tm1) < $testtime ) { for ($f = 1; $f <= $nkbc; $f++) { print ". "; } $tm2 = time; $nkb = $nkb + $nkbc; print "$nkb"; print "kiB"; } if ( ($tm2-$tm1) < $testtime ) { for ($f = 1; $f <= $nkbd; $f++) { print ". "; } $tm2 = time; $nkb = $nkb + $nkbd; print "$nkb"; print "kiB"; } if ( ($tm2-$tm1) < $testtime ) { for ($f = 1; $f <= $nkbe; $f++) { print ". "; } $tm2 = time; $nkb = $nkb + $nkbe; print "$nkb"; print "kiB"; } print "
\n"; $adresa = "$ENV{'REMOTE_ADDR'}"; $server = "$ENV{'SERVER_NAME'}"; print "\n

"; $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/($tm2-$tm1+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 "Bander speed test\n"; print "

"; WebSVN - czfcentos - Blame - Rev 2 - /trunk/router/home/www/cgi-bin/bander.cgi
  jablonka.czprosek.czf

czfcentos

Subversion Repositories:
[/] [trunk/] [router/] [home/] [www/] [cgi-bin/] [bander.cgi] - Blame information for rev 2

 

Line No. Rev Author Line

Powered by WebSVN 2.2.1