Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to only time the subroutine call in Perl?

I am wondering if there is a Perl profiler out there that can profil the time spend in the subroutine call of a specific subroutine.

I do not want to time the whole subroutine (from call to return), but only the time spend by Perl in calling the subroutine (between call and the first instruction of the subroutine).

Is this possible ? (Whithout hand-adding time function in all my 90k line of code of course :))

Thanks.

like image 803
Mayeu Avatar asked Dec 20 '22 20:12

Mayeu


1 Answers

It seems you need Devel::NYTProf's line profiling mode. "Time on line" column will show you how much is spent on processing line where you make call, excluding time taken in called sub.

like image 158
Oleg V. Volkov Avatar answered Dec 27 '22 02:12

Oleg V. Volkov