According to the comments on this blog post, the following method performs the operation asynchronously, but is waiting for redrawing:
function nextTick(callback) { var img = new Image; img.onerror = callback; img.src = 'data:image/png,' + Math.random(); }
whereas this one does not wait for redrawing:
var mc = new MessageChannel; function nextTick(callback) { mc.port1.onmessage = callback; mc.port2.postMessage(0); }
How can I check this, programmatically, so that I can check the automatic tests running on multiple platforms / browsers?
source share