Timers extension: after X, debounce, throttle, and in-background

Hello world,

I create a new “Timers” extension: https://github.com/darzu/arcade-timers
Early beta.

Sample: https://makecode.com/_c57bYTea0RFV



“After X do” / aka setTimeout:

“Separately do” / aka run in background thread:

“after Y settled for X do” / aka debounce:

“for Y at most once every X do” / aka throttle:


Oooh. These look nice! I’m curious if there are many implementation differences between your setTimeout equivalent and @peli’s recently posted setTimeout-sounding block:

1 Like

My APIs are integrated into the arcade runtime, eg they will run at the same priority as the “on game update” handler.

1 Like

Ah. I should probably learn more about this.

Is this documentation still mostly relevant? https://arcade.makecode.com/developer/game-loop … the version number mentioned in the beginning looks to be a bit behind the current release.

1 Like

Yes it’s pretty good. This part has not changed much.