Executes a callback function on the next tick of the event loop or animation frame.
This function provides a consistent way to defer execution across different environments.
In browser environments, it uses requestAnimationFrame for smooth visual updates.
In Node.js or non-browser contexts, it uses setImmediate (if available) or setTimeout.
Executes a callback function on the next tick of the event loop or animation frame. This function provides a consistent way to defer execution across different environments.
In browser environments, it uses requestAnimationFrame for smooth visual updates. In Node.js or non-browser contexts, it uses setImmediate (if available) or setTimeout.