To get the time spent executing a method (and all methods that it calls) in your application, do the following:
-
Profile your application using the Performance profiler with the Elapsed Time, User Time or User+Kernel Time counter.
-
Get the profiling results.
-
Select the Routines category in the Explorer panel.
-
Find the desired function in the Report panel.
-
Check the Time with Children column.
To see this as a percentage relative to other methods, check % with Children. The total against which the percentage is figured is in the footer of Time with Children. It is normally much larger than the actual runtime since child calls are counted both for the caller and for the callee.
To get more statistics on the methods that were called by the one selected in the Report panel, refer to the Details panel.
See Also
Performance Profiling
Best Practices and How to Tutorials
Measure the Total Time Spent Executing a Method (Including Child Methods)
Performance Profiler - Overview