The difference requestAnimationFrame and seeTimeout

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  )
        
    

Guess you like

Origin www.cnblogs.com/alchemist-z/p/12233278.html