Using setTimeout()
to perform an action after rendering would be a hack. You'd have to guess at how much elapsed time it will take the browser to do the rendering, and you won't be able to make that 100% reliable. So, I'd say just don't do it.
The point of $A.getCallback()
, as you say, for when things happen outside the Lightning event loop. That may be using setTimeout
(for a scenario when you really do want a delay in terms of time), or when another framework needs a callback (e.g. Promises, jquery-ui callbacks, etc.).
The only way to reliably know that a component has been rendered is to use either a custom renderer (on the afterRender
and/or rerender
events), or handle the render event (new in Summer 17). You should almost never need to do this unless you are making use of a Javascript library. If you're doing something like adding event handlers in a renderer, you'd be better using Lightning to achieve the same results.
On the whole, any direct interaction with the DOM is much more complicated than just working within the components you're given and interacting with them as components rather than elements. So, avoid it unless you really have to.