-
Hello there, i was looking at the bunnymark example to see how this package works and i saw something interesting. There is a ticker that ticks every 500ms but the Update loop runs at 16ms (60 TPS), so if the timer starts right now and the update loop is called, how is it that this code is not blocking the update loop execution for ~500ms until the first tick? I know this might be more of a "how select statement" works in go more then your ecs library or ebitengine but I thought it would be better to ask directly at the source. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi @wizzymore, The ticker runs independently in the background. Between ticks, the update loop keeps running normally. |
Beta Was this translation helpful? Give feedback.
Hi @wizzymore,
The update loop isn't blocked because of how Go's select statement works with
time.Ticker
. The select has a default case, making it non-blocking. It checks for a tick, but immediately moves on if there isn't one.The ticker runs independently in the background. Between ticks, the update loop keeps running normally.