A rewrite of the setInteval/clearInterval functions using setTimout/clearTimeout