Conversation
`Tick.delta` was set to the per-frame render delta (~16ms at 60fps) for both one-shot and repeating timers, so `everyMs(100)` reported ~16ms instead of ~100ms — contradicting its "nanoseconds since last tick" doc. Deliver the actual timer delta instead: - repeating (`every`): time since the previous tick (`elapsed - last_every_tick`) - one-shot (`tick`): time since the tick was scheduled, via a new `pending_tick_scheduled_at` anchor The per-frame render delta remains available via `ctx.delta` / `ctx.deltaSec()` / `ctx.fps()`. On suspend/resume both timer anchors are rebased to the resume instant so the first post-resume delta is a normal interval rather than the whole suspended span. Rewrote the `Tick.delta` doc comment to match the actual behavior. Fixes #116
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Tick.deltawas set to the per-frame render delta (~16ms at 60fps) for both one-shot and repeating timers, soeveryMs(100)reported ~16ms instead of ~100ms, contradicting its "nanoseconds since last tick" documentation. This now delivers the actual timer delta — time since the previous tick for repeating timers (every), and time since the tick was scheduled for one-shot timers (tick, via a newpending_tick_scheduled_atanchor) — while the per-frame render delta remains available throughctx.delta/ctx.deltaSec()/ctx.fps(). On suspend/resume both timer anchors are rebased to the resume instant so the first post-resume delta is a normal interval rather than the whole suspended span. TheTick.deltadoc comment was rewritten to match the real behavior.zig buildandzig build testpass.Fixes #116