Python profile & Time Analysis

```bash
python -m cProfile myscript.py
python -m profile myscript.py
```

```python
import cProfile, pstats
pr = cProfile.Profile()
pr.enable()
###################Your Code or Function Here
pr.disable()
ps = pstats.Stats(pr).strip_dirs().sort_stats('cumulative')
ps.print_callees()
```

评论

此博客中的热门博文

Windows下ShadowSocks客户端安装和配置 顺带KCP

How to Install KeePass on M1 Mac

How User Friendly is a MacOS