#!/usr/bin/perl -w use IO::Socket; $port = 80; $host = "localhost"; $starttime = time; $max = 100; $count = 0; $lastdelta = 0; print "Time\tRequests"; do { &Do; $count++; $delta = time - $starttime; if ($delta != $lastdelta) { print "\n$delta\t$count"; $lastdelta = $delta; } }while($delta<=$max); sub Do { $remote = IO::Socket::INET->new(Proto => "tcp", PeerAddr => $host, PeerPort => "http(80)"); unless($remote) { $count--; return; } $remote->autoflush(1); print $remote "GET /test.html HTTP/1.0\n\n"; while (<$remote>) { } close $remote; }