The question is in the title. At least it will be a very handy feature to have a function returning a millisecond counter (similar to the Windows
GetTickCount function) to estimate which code the most slow.
Please raise requests for features like this in the Issue Tracker. This will help us keep track of the demand for different feature requests.