2004-11-21 07:35:22 +01:00
|
|
|
#!/usr/bin/perl
|
|
|
|
|
|
|
|
require 'sys/syscall.ph';
|
|
|
|
$|=1;
|
|
|
|
|
|
|
|
$total = 1;
|
2004-11-22 01:10:35 +01:00
|
|
|
$target = "http://www.cnn.com/";
|
2004-11-21 07:35:22 +01:00
|
|
|
|
|
|
|
for($i=0;$i<$total;$i++) {
|
|
|
|
print "Starting client $i\n";
|
|
|
|
$pid = fork();
|
|
|
|
if(!$pid) {
|
2004-11-22 01:10:35 +01:00
|
|
|
open(FD,"wget -q -O - $target|");
|
2004-11-21 07:35:22 +01:00
|
|
|
$c = 0;
|
|
|
|
while(<FD>) {
|
|
|
|
$c += length($_);
|
|
|
|
}
|
|
|
|
$TIMEVAL_T = "LL";
|
|
|
|
$now = pack($TIMEVAL_T, ());
|
|
|
|
syscall(&SYS_gettimeofday, $now, 0) != -1 or die "gettimeofday: $!";
|
|
|
|
@now = unpack($TIMEVAL_T, $now);
|
2004-11-22 01:10:35 +01:00
|
|
|
print "Client $i exiting ($c chars).\n";
|
2004-11-21 07:35:22 +01:00
|
|
|
exit(0);
|
|
|
|
}
|
|
|
|
# sleep(1);
|
|
|
|
}
|
|
|
|
|