了解spyder的探查器结果python

2024-10-01 07:44:01 发布

您现在位置:Python中文网/ 问答频道 /正文

我使用的是python2.7.11和spyder的(v2.3.8)profiler,但是我无法理解结果。 这是按“总时间”排序的结果图像

enter image description here

我有两个问题:

1)mainloop使用216.012总时间。我怎么知道我的代码的哪个部分/行在调用这些函数?在

2)在函数noise_kauff(我定义的)中,总时间是20.51,但是noise_kauff内的第一行使用51.629?在


Tags: 函数代码图像定义排序时间profilernoise
1条回答
网友
1楼 · 发布于 2024-10-01 07:44:01

Note that the time and call values shown by [spyder-profiler] are global to the execution of the program and not specific to a particular call. Because of this, some functions/methods may show longer times than their callers.

http://sjara.github.io/spyder-profiler/

在您的示例中,__getitem__大概从noise_kauff加上从其他地方运行了大约半分钟。不幸的是,spyder只是把它们加在一起-这是一个已知的问题/错误。在

相关问题 更多 >