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

Remove Timer.relativeTime #2416

Merged
merged 1 commit into from
Oct 17, 2023

Conversation

adroitwhiz
Copy link
Contributor

Resolves

Resolves #2401

Proposed Changes

This PR removes the Timer.relativeTime function.

Reason for Changes

Timer.relativeTime contains the exact same code as Timer.time, is not used anywhere in the current codebase, and as such is dead code.

Test Coverage

Also removed it from the MockTimer class.

Copy link
Contributor

@fsih fsih left a comment

Choose a reason for hiding this comment

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

The commit that took this out says "Disable use of more accurate timer temporarilly due to performance." I guess we never felt we needed the extra accuracy again?

@adroitwhiz
Copy link
Contributor Author

I guess we never felt we needed the extra accuracy again?

That and I'm not sure if relativeTime was ever used (it's currently not), meaning that even if relativeTime was more accurate, there doesn't appear to be any place in the codebase that needs the extra accuracy?

According to MDN, performance.now's precision was limited as a Spectre mitigation anyway, which might also affect things.

@cwillisf cwillisf merged commit 15cdd2f into scratchfoundation:develop Oct 17, 2023
@github-actions
Copy link

🎉 This PR is included in version 2.1.5 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Timer.relativeTime is unused
3 participants