|
@@ -1,28 +1,25 @@
|
|
#!/usr/bin/perl
|
|
#!/usr/bin/perl
|
|
|
|
|
|
require 'sys/syscall.ph';
|
|
require 'sys/syscall.ph';
|
|
-use POSIX qw(strftime);
|
|
|
|
$|=1;
|
|
$|=1;
|
|
|
|
|
|
$total = 1;
|
|
$total = 1;
|
|
|
|
+$target = "http://www.cnn.com/";
|
|
|
|
|
|
for($i=0;$i<$total;$i++) {
|
|
for($i=0;$i<$total;$i++) {
|
|
print "Starting client $i\n";
|
|
print "Starting client $i\n";
|
|
$pid = fork();
|
|
$pid = fork();
|
|
if(!$pid) {
|
|
if(!$pid) {
|
|
- open(FD,"wget -q -O - http://www.cnn.com/|");
|
|
+ open(FD,"wget -q -O - $target|");
|
|
$c = 0;
|
|
$c = 0;
|
|
while(<FD>) {
|
|
while(<FD>) {
|
|
$c += length($_);
|
|
$c += length($_);
|
|
}
|
|
}
|
|
- ($s, $usec) = gettimeofday;
|
|
|
|
$TIMEVAL_T = "LL";
|
|
$TIMEVAL_T = "LL";
|
|
$now = pack($TIMEVAL_T, ());
|
|
$now = pack($TIMEVAL_T, ());
|
|
syscall(&SYS_gettimeofday, $now, 0) != -1 or die "gettimeofday: $!";
|
|
syscall(&SYS_gettimeofday, $now, 0) != -1 or die "gettimeofday: $!";
|
|
@now = unpack($TIMEVAL_T, $now);
|
|
@now = unpack($TIMEVAL_T, $now);
|
|
-# $now_string = strftime "%b %d %H:%M:%S", gmtime;
|
|
+ print "Client $i exiting ($c chars).\n";
|
|
-# $now_string .= $now[1]/1000;
|
|
|
|
- print "Client $i exiting ($c chars: $now[1]).\n";
|
|
|
|
exit(0);
|
|
exit(0);
|
|
}
|
|
}
|
|
# sleep(1);
|
|
# sleep(1);
|