Search code examples
pythonprofilingipythonexecution-time

Profiling of function with small execution time using %prun


How can I do the profiling of functions in python which have very low execution time? I am getting 0 in most of the functions.


Solution

  • Put a loop around it to run it some large number of times, like 10^6, so it takes at least several seconds.

    Then the method I use to see how time is spent is this.