mirror of
https://github.com/rust-windowing/winit.git
synced 2026-06-26 22:53:15 -04:00
11 lines
244 B
JavaScript
11 lines
244 B
JavaScript
onmessage = event => {
|
|
const [port, timeout] = event.data
|
|
const f = () => port.postMessage(undefined)
|
|
|
|
if ('scheduler' in this) {
|
|
scheduler.postTask(f, { delay: timeout })
|
|
} else {
|
|
setTimeout(f, timeout)
|
|
}
|
|
}
|