title: Javascript run loop for specified time
body: <p>I have a function that interfaces with a telephony program, and calls people. I want to know, is there a method that I can use to call folks for a certain amount of time?</p>
  
  <p>I'd like to run a loop like:</p>
  
  <pre><code>while(flag = 0){
      call(people);
  
      if(&lt;ten minutes have passed&gt;){
          flag = 1;
      }
  }
  </code></pre>
  
  <p>Any help would be appreciated.</p>