benchmark
#!/usr/bin/perl use Benchmark; #builtin module # declare array my @data; # start timer $start = new Benchmark; # perform a math operation 200000 times for ($x=0; $x<=200000; $x++) { $data[$x] = $x/($x+2); } # end timer $end = new Benchmark; # calculate difference $diff = timediff($end, $start); # report print "Time taken was ", timestr($diff, 'all'), " seconds"; # href="http://articles.techrepublic.com.com/5100-10878_11-5278558.html" title="http://articles.techrepublic.com.com/5100-10878_11-5278558.html" class="linked" target="_blank">http://articles.techrepublic.com.com/5100-10878_11-5278558.html
1
1 Total