-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement HTML standard timer APIs #50
Comments
Can we do a promise version instead? |
@devsnek we could, although I will admit I fail to see value in creating a new timer API that is specific to JSTime. might be worth discussing with HTML + maybe node (deno?) if other platforms would be interested in a promise based API as well |
Regardless of API, this would still be likely blocked by #12. |
As pointed by @bengl timers require event loop. FYI - we'll be moving those APIs to a separate crate in near(-ish) future. |
for timers I would expect a thread with a timer wheel anyway, so not a huge issue for tokio to not be involved. |
As documented in https://html.spec.whatwg.org/multipage/timers-and-user-prompts.htm
@bdougie brought this in #27 (comment)
This would include:
setTimeout()
setInterval()
clearTimeout()
clearInterval()
In deno this is how it is implemented
https://github.com/denoland/deno/blob/master/cli/global_timer.rs
https://github.com/denoland/deno/blob/master/cli/rt/11_timers.js
Definitely interesting that the JavaScript runtime extensions are implemented in deno_cli not deno_core
The text was updated successfully, but these errors were encountered: