title: how to reduce this javascript code's cpu usage?
body: <p>nowadays i am optimizing some js code.<br/>
  there is a function named appendXYZ,and it is invoked in a loop with other functions.<br/>
  it looks like as the following:<br/></p>
  
  <pre><code>function OuterFunc (){
    for(...){// about 150 times
       ...
       appendXYZ();
       //other dependent functions
       ...
    }
  }
  </code></pre>
  
  <p>and now i am pretty sure that appendXYZ cause high cpu usage - it can reach 50%,<br/>
  but if i remove this function,cpu usage is only 1%.<br/>
  when the cpu usage is 50%,the browser is nearly frozen and the page is lack of responsiveness.<br/>
  what is more ,the OuterFunc execute every 20 seconds and appendXYZ is from a third party script code and i cant modify it.<br/>
  <strong>so how to optimize this code?</strong><br/></p>
  
  <p>now i am trying to use setTimeout but i dont know whether it works.</p>