Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/bslatkin/effectivepython
/ countdown
Method
countdown
example_code/item_109.py:80–83 ·
view source on GitHub ↗
(self, duration, callback)
Source
from the content-addressed store, hash-verified
78
self.timer = None
79
80
def
countdown(self, duration, callback):
81
self.end()
82
self.timer = threading.Timer(duration, callback)
83
self.timer.start()
84
85
def
end(self):
86
if
self.timer:
Callers
3
test_countdown
Method · 0.95
test_end
Method · 0.95
push_down
Method · 0.80
Calls
1
end
Method · 0.95
Tested by
2
test_countdown
Method · 0.76
test_end
Method · 0.76