tor-stress 532 B

123456789101112131415161718192021222324252627
  1. #!/usr/bin/perl
  2. #require 'sys/syscall.ph';
  3. $|=1;
  4. $total = 1;
  5. $target = "http://www.cnn.com/";
  6. for($i=0;$i<$total;$i++) {
  7. print "Starting client $i\n";
  8. $pid = fork();
  9. if(!$pid) {
  10. open(FD,"wget -q -O - $target|");
  11. $c = 0;
  12. while(<FD>) {
  13. $c += length($_);
  14. }
  15. # $TIMEVAL_T = "LL";
  16. # $now = pack($TIMEVAL_T, ());
  17. # syscall(&SYS_gettimeofday, $now, 0) != -1 or die "gettimeofday: $!";
  18. # @now = unpack($TIMEVAL_T, $now);
  19. print "Client $i exiting ($c chars).\n";
  20. exit(0);
  21. }
  22. # sleep(1);
  23. }