看板 Python 關於我們 聯絡資訊
想請問一下 有沒有簡單的方式可以記錄 某一個python script或function在執行時 所消耗的cpu memory ...等等 已經查到一些可能跟這相關的東西有 top (linux command) psutil (python module) 但是還是不太了解 有人願意分享一下經驗嘛? 我的用途主要是做效能回報 PS. OS為Ubuntu -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.112.4.198
DemonDeath:簡單的python tool有line_profiler跟memory_profiler 01/10 15:20
amigcamel:line_profiler 可以profile CPU usage 嗎? 01/10 15:58
Wush978:OS中直接用system call 查/proc/<pid>/status來看狀態 01/11 00:09