Skip to content

Instant::now does not work in Web Workers #12

@knpwrs

Description

@knpwrs

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, so web_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: wasm-bindgen/wasm-bindgen#1046

EDIT: To be specific, Instant::now() is not working inside of web workers because web_sys::window() does not work there. I'm hoping there's still a way to somehow access self.performance.now() inside a web worker using this module.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions