[英]Python profile: How to get the time for each individual execution (no aggregation)
我正在嘗試調試一個基於 python 的項目,該項目涉及對同一組函數的多次重復調用。 此代碼是 API 的一部分。
但是,隨着時間的推移,這些函數的執行時間會線性增加。 我現在需要找出導致單個請求完成的總時間增加的原因。 有沒有辦法分析 python 代碼並為每次重復調用函數的執行獲取 output?
As an abstract example: Let's say function 1 involves calls to function 1, function 2, function 3. I call function 1 10,000 times and then notice that the execution of function 1 took initially 0.5 seconds but increases to 5 seconds at the 10,000 call to它。 如何確定 function 1、function 2 或 function 3 是否導致了這種增加?
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.