Skip to main content
100%

Loop

✓ Published0🌍 Public
Aabernier
Last edited Oct 13, 2020
Created on Aug 1, 2012

This visualization demonstrates a minimal animation loop utility, where a callback function executes repeatedly with timestamps for each frame. It shows how to manage continuous animation cycles using either `window.requestAnimationFrame` or `setTimeout`-based periodic timeouts, depending on whether a fixed interval is specified. The code defines a reusable `Loop` class with start and stop methods, supporting both animation frame precision and custom timing intervals. It uses the performance timing API to normalize timestamps, ensuring consistent time values across different browser implementations. The example serves as a foundation for building custom animated visualizations with precise control over frame timing.

AI-generated description

DEPRECATED: use https://github.com/abernier/loop instead

ISC Licensed

Similar vizzes