← all demos

Rendering

Making render() an effect: it re-runs when something it read changes, and a scheduler decides when. In on-demand mode an idle sketch draws nothing at all — the frame loop still turns, but there is no work in the queue.

Per second

The loop

loop.js
Try: in on demand mode, leave it alone — draws falls to zero while frames keep ticking. Drag a slider and it draws only while you drag. Turn Animate on and the time signal makes it dirty every frame, so it goes back to drawing continuously — animating and reacting are the same mechanism.