aboutsummaryrefslogtreecommitdiff
path: root/contrib/tor-stress
blob: a0c88c2fdd74b8c333d7d2c781abf937232005e3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/usr/bin/perl

#require 'sys/syscall.ph';
$|=1;

$total = 1;
$target = "http://www.cnn.com/";

for($i=0;$i<$total;$i++) {
  print "Starting client $i\n";
  $pid = fork();
  if(!$pid) {
    open(FD,"wget -q -O - $target|");
    $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);
    print "Client $i exiting ($c chars).\n";
    exit(0);
  }
# sleep(1);
}