measure elapsed time of step in debugger

I think it would be handy to know how long it takes to make a single step in the debugger, as a handy way to profile code. I know I can use the profiler feature of xdebug, but it's a lot more work to have to enable profiling, and then load the file into phpstorm/cachgrind for analysis.

This way, every time I step over a function call, it would automatically tell me how long it took to execute that specific step.

Does something like this already exist in phpstorm?

Comment actions Permalink

I think there's ways to solve accuracy to a certain degree. Even if it's innacurate, I think it would still be useful in many scenarios. Most of the features in intellij aren't perfect, but they still push out imperfect features because it's often better than not having it.

While I appreciate your opinion about the usefulness of such a feature, I think you're a sensible person who can agree that this is a matter of opinion, and that others may not share your evaluation of where to draw the line to determine what is and isn't a time saving useful feature.

But, thanks for confirming such a feature doesn't currently exist.

Comment actions Permalink

Hi there,

All profiler info is supplied by xdebug. AFAIK such info is not available during actual debugging (step in/over etc).

If PhpStorm will be used to actually measure such time .. it will be inaccurate (time lost during communication with xdebug etc).

Therefore using xdebug profiler alone is the right way of doing things .. and no -- it's not "lot more work to have to enable profiling, and then load the file into phpstorm/cachgrind for analysis" -- you make code, measure execution time, improve, measure again. Measuring code execution time during active debug session does not make real sense -- it always will be inaccurate.


Please sign in to leave a comment.