Skip to content
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

Update js wasi clocks #118

Merged
merged 2 commits into from
Jul 27, 2023
Merged

Conversation

kajacx
Copy link
Contributor

@kajacx kajacx commented Jul 27, 2023

performance.now() returns milliseconds, and we want nanoseconds, so we need to multiply by a million, not a billion.

Using one Date.now() prevents a "bad" case when one first Date.now() call returns a different date than the second Date.now() call, which can be especially bad if the two dates "cross over" the millisecond boundary.

This prevents a "bad" case when one first Date.now() call returns a different date than the second Date.now() call, which can be especially bad if the two dates "cross over" the millisecond boundary.
performance.now() returns milliseconds, and we want nanoseconds, so we need to multiply by a million, not a billion.
Copy link
Collaborator

@guybedford guybedford left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks so much for PRing

@guybedford guybedford merged commit a4e36c9 into bytecodealliance:main Jul 27, 2023
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants