title: I am getting [Violation] 'setInterval' handler took N ms warning in chrome dev and after that application get freezed
body: <p>On running a setInterval call I am getting this issue. 
  [Violation] 'setInterval' handler took ms
  In my understanding we get this issue when we write a code inside setInterval which takes more time to execute. My problem is how to solve this issue if there is no way I can alter the code running inside setInterval.</p>
  
  <pre><code>let cardInterval = setInterval(() =&gt; {
      if (self.filterObject != undefined) {
        self.getFilteredListOfTurbine(self.globalFilterService.getUpdatedTurbineListWithOperatingMode(self.listOfTurbine)).then((response) =&gt; {
          self.cardData.turbines = response;
          self.cardData.recalculate();
          observable.next(self.cardData);
        })
      } else {
        self.cardData.turbines = self.globalFilterService.getUpdatedTurbineListWithOperatingMode(self.listOfTurbine);
        self.cardData.recalculate();
        observable.next(self.cardData);
      }
    }, 1000);
  </code></pre>
  
  <p>The above code works fine when self.filterObject is undefined but when its not It need to do a extra filtering which is in self.getFilteredListOfTurbine.</p>
  
  <pre><code>  getFilteredListOfTurbine(listOfTurbine): Promise&lt;Turbine[]&gt; {
  return new Promise((resolve) =&gt; {
    if (this.filterObject == undefined) {
      return listOfTurbine;
    }
    let self = this;
    let listOfFilteredTurbine = new Array&lt;Turbine&gt;();
    listOfTurbine.forEach((turbine, i) =&gt; {
      if (self.filterObject.wf.includes(turbine.wfoid) &amp;&amp; self.filterObject.tu.includes(turbine.turbineserialnumber) &amp;&amp; self.filterObject.tt.includes(turbine.hwtype) &amp;&amp; self.filterObject.om.includes(turbine.turbineoperatingmode)) {
        if (self.filterObject.ro &amp;&amp; self.filterObject.ro.length &gt; 0) {
          let addTurbine = this.applyRulesOnTurbine(turbine, self.getRuleObject());
          if (addTurbine) {
            listOfFilteredTurbine.push(turbine);
          }
        }
        else {
          listOfFilteredTurbine.push(turbine);
        }
      }
      if (i == listOfTurbine.length - 1) {
        return resolve(listOfFilteredTurbine);
      }
    })
  })
  </code></pre>
  
  <p>}</p>
  
  <p>I dont feel I could change the logic of filtering here. Please help me in fixing this violation issue.</p>
  
  <p>Thanks</p>