-
Notifications
You must be signed in to change notification settings - Fork 37
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
Instant::now does not work in Web Workers #12
Comments
The gloo project had to fix a similar issue: rustwasm/gloo#56 I'm not sure how much work it would be to implement a similar solution here. It seems as though |
knpwrs
changed the title
Does not work in Web Workers
Instant::now does not work in Web Workers
Sep 20, 2020
There is a similar issue opened for the |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This library was working excellently until I tried to port some code I wrote to run in a web worker rather than in the main process.
window
does not exist in web workers, soweb_sys::window()
fails. That said,self.performance()
is a thing in web workers so I think this module should be able to be updated to work in all browser environments.This is the behavior I'm seeing using this module in a web worker: rustwasm/wasm-bindgen#1046
EDIT: To be specific,
Instant::now()
is not working inside of web workers becauseweb_sys::window()
does not work there. I'm hoping there's still a way to somehow accessself.performance.now()
inside a web worker using this module.The text was updated successfully, but these errors were encountered: