how to measure execution time of functions (automatically) in Python

前端 未结 3 443
无人共我
无人共我 2020-12-13 10:00

I need to have a base class which I will use to inherit other classes which I would like to measure execution time of its functions.

So intead of

3条回答
  •  孤城傲影
    2020-12-13 10:36

    Have you checked the "profile" module?

    I.e. are you sure you need to implement your own custom framework instead of using the default profiling mechanism for the language?

    You could also google for "python hotshot" for a similar solution.

提交回复
热议问题