Perl Devel::FastProf is a profiler for perl source code.
By default it measures the time spent executing each line of code and the number of times it was executed.
Uniquely, it can also work with other levels of granularity, most notably blocks and loops.