pastebin - collaborative debugging

pastebin is a collaborative debugging tool allowing you to share and modify code snippets while chatting on IRC, IM or a message board.

This site is developed to XHTML and CSS2 W3C standards. If you see this paragraph, your browser does not support those standards and you need to upgrade. Visit WaSP for a variety of options.

pastebin private pastebin - collaborative debugging tool What's a private pastebin?

Posted by Anonymous on Tue 13th Jan 19:05 (modification of post by view diff)
diff | download | new post

  1. $ time perl hash.pl
  2.  
  3. real    0m0.140s
  4. user    0m0.064s
  5. sys     0m0.011s
  6. $ time perl array.pl
  7.  
  8. real    0m29.102s
  9. user    0m26.492s
  10. sys     0m0.056s
  11.  
  12. array.pl
  13. #!/usr/bin/perl
  14.  
  15. for($i=0;$i<10000;$i++) {
  16.    $d[$i] = $i ;
  17. }
  18.  
  19. for($p=0;$p<10000;$p++) {
  20.    foreach(@d) {
  21.      last if ($_ eq "5000");
  22.    }
  23. }
  24.  
  25. hash.pl
  26. #!/usr/bin/perl
  27.  
  28. for($i=0;$i<10000;$i++) {
  29.    $d{$i} = $i ;
  30. }
  31.  
  32. for($p=0;$p<10000;$p++) {
  33.   $i = $d{5000};
  34. }

Submit a correction or amendment below. (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.

Use syntax highlighting

To highlight particular lines, prefix each line with @@


Remember my settings