use Benchmark; $start=new Benchmark; run_around_in_circle(1000); $end=new Benchmark; print timestr(timediff($end, $start));