Add separate loop between requestanimation on frame (for render) and logic