Use recursion timeout instead of setInterval