windows.setInterval rewrite