Corountine for main loop such as requestAnimationFrame.