MCPcopy Index your code
hub / github.com/RustPython/RustPython / timeout

Function timeout

crates/wasm/Lib/asyncweb.py:201–210  ·  view source on GitHub ↗
(ms)

Source from the content-addressed store, hash-verified

199 _settimeout = browser.window.get_prop("setTimeout")
200
201 def timeout(ms):
202 prom = CallbackPromise()
203
204 @browser.jsclosure_once
205 def cb(this):
206 print("AAA")
207 prom.resolve(None)
208
209 _settimeout.call(cb.detach(), browser.jsfloat(ms))
210 return prom

Callers

nothing calls this directly

Calls 3

CallbackPromiseClass · 0.85
callMethod · 0.45
detachMethod · 0.45

Tested by

no test coverage detected