#!/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 ############################################### use Time::HiRes; print "Content-type: text/html\n\n"; print "
"; print "\n"; # nocache! $kb = 50*1024; @nkbp = (10,20,70,100,300,500); $nkb = 0; $lnkbp = $#nkbp; @pism = ("aaaaaaaaaa","bbbbbbbbbb","cccccccccc","dddddddddd","eeeeeeeeee","ffffffffff"); $svrtimeout = 30; # httpd server timeout in seconds $testtime = 10; # maximum test time $lospd = $nkbp[0]/$svrtimeout; print "";
$time = ($tm2);
$numMb = $nkb * $kb/1000024;
printf "Odesláno %.2f MiB ze serveru $server na IP adresu $adresa za %.2f sekund
\n", $numMb, $time;
print "Přibližná rychlost stahování Vašeho připojení je: ";
$speed = $nkb*$kb/$tm2;
$speedkb = $speed/1024;
$speedkbps = 8*$speed/1024;
printf "%.2f B/s = %.2f kiB/s = %.2f Mib/s\n", $speed, $speedkb, $speedkbps/1000;
printf "
![]() ![]() |
banderdyn |
Subversion Repositories: |
Line No. | Rev | Author | Line |
---|