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

Lily/MoreTimers: Don't rely on system clock #1898

Merged
merged 2 commits into from
Feb 1, 2025

Conversation

DNin01
Copy link
Collaborator

@DNin01 DNin01 commented Jan 29, 2025

This prevents the More Timers extension from being thrown off by system clock changes.

Tested, no breaking changes.

@DNin01 DNin01 added the pr: change existing extension Pull requests that change an existing extension label Jan 29, 2025
@DNin01 DNin01 requested a review from GarboMuffin January 29, 2025 20:24
@DNin01
Copy link
Collaborator Author

DNin01 commented Jan 29, 2025

!format

@DNin01
Copy link
Collaborator Author

DNin01 commented Jan 29, 2025

I think we can still do better — Scratch's timer uses a VM interface which only updates between frames. In More Timers, if a script takes a long time to execute (e.g., a long run-without-screen-refresh loop) the values of the timers could change during execution, which works differently than Scratch's. However, fixing this parity issue might require breaking changes.

@CubesterYT
Copy link
Member

Maybe we could look into stack timer?

@GarboMuffin
Copy link
Member

Stack timer great for within a block but the timers outlive each individual block here

@GarboMuffin
Copy link
Member

Wouldn't be opposed to removing the Math.floor()

@CubesterYT CubesterYT merged commit 725eac3 into TurboWarp:master Feb 1, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr: change existing extension Pull requests that change an existing extension
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants