$t1 = Benchmark->new; # First chunk from the code above $t2 = Benchmark->new; $t3 = Benchmark->new; # Second chunk from the code above $t4 = Benchmark->new; $td1 = timediff($t2-$t1); $td2 = timediff($t4-$t3); print timestr($td1),"\n",timestr($td2);