提交 5e6d79bf authored 作者: James Bergstra's avatar James Bergstra

Stack VM - comment on why timing is clamped above 0

上级 f8583b40
...@@ -239,6 +239,10 @@ class Stack(VM): ...@@ -239,6 +239,10 @@ class Stack(VM):
idx = self.node_idx[node] idx = self.node_idx[node]
t0 = time.time() t0 = time.time()
rval = self.thunks[idx]() rval = self.thunks[idx]()
# Some thunks on some computers run faster than the granularity
# of the time.time clock.
# Profile output looks buggy if a node has run but takes 0 time.
dt = max(time.time() - t0, 1e-10) dt = max(time.time() - t0, 1e-10)
if self.callback is not None: if self.callback is not None:
self.callback( self.callback(
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论