With requestAnimationFrame refresh your browser and executed.
let a = () =>{
doSomething() ;
window.requestAnimationFrame( function );
}
window.requestAnimationFrame( function );
seeTimeout cross refresh every time a certain time to perform with the browser's blind spots.
let a = () => {
doSomething();
window.setTimeout( function, yourIntervalTime );
}
window.setTimeout( function, yourIntervalTime )