Profiling a Python Script
SOLUTION 1:
The main common option would be to use the profile (or cprofile) module.There are two different ways of using it :- As a module, by directly running
```python -m cProfile script.py```
- In your code, by importing the utilities
```
import cProfile
cProfile.run('function()') # in your __main__
```
Bonus : You can use several options for sorting results using theĀ -s switch (cumulative/name/time/file sorting are available).