Before 2011, most programmers use setTimeout( ) to make animation, because back then, window.requestAnimationframe() was not cross browser supported yet. After 2011, you could see people only use window.requestAnimationframe() to make animation. But I wonder, why do we use window.requestAnimationframe() with several other lines to make sure all browsers can perform correctly, rather than a simple line with setTimeout(). Today, I found the answer from Professional JS for Web Developers, on page 253.
” True intervals are rarely used in production environment because the time between the end of one interval and the beginning of the next is not necessarily guaranteed, and some intervals may be skipped. Using timeouts ensures that can’t happen. Generally speaking, it’s best to avoid intervals. “