Jamal Rnjbal
Jamal Rnjbal

Reputation: 35

Can the Pycharm profiler, cProfile, be set to profile only a couple of lines of code and not the whole script?

Pycharm's standard profiler for python is cProfile or Yappi.
While using cProfile in Pycharm, you don't have to change or edit your code, you just have to use the graphical interface and press the profile button.
However, whenever I do this, Pycharm runs the whole script or file and gives me results. Is there a way to profile only a few lines of code in the script, or maybe a function, In order to save time?

I have tried setting up break points and it didn't do the trick.

Thank you in advance,

Jamal

Upvotes: 2

Views: 1472

Answers (0)

Related Questions