title: how to use setTimeout or setInterval properly
body: <p>I am using google maps and i am trying to put a pause in execution to prevent QUERY_LIMIT usage issue. My function that plots the addresses looks like this.</p>
  
  <p>The code works, however i want to try setTimeout or setInterval to see if its going to look better on UI. </p>
  
  <p>How do i call it, what should be the first argument?</p>
  
  <p>Thanx alot.</p>
  
  <pre><code>  vLocations = [];
  
    for (var i = 0; i &lt; vAddresses.length; i++) {
  
      //pause to prevent OVER_QUERY_LIMIT issue
      //geocode "free" usage limit is 5 requests per second
      //setTimeout(PlotAddressesAsUnAssigned, 1000);
      //sleep(500);
  
      //this will resolve the address and store it in vLocations
      AddWaypointAndUnassigned(vAddresses[i]);
  
      var z = i % 4;
      if (z==0 &amp;&amp; i != 0) {
       //sleep after every 5th geocode call
       //alert('going to sleep...i: ' + i);
       //sleep(3000);
      }
  
    }
  </code></pre>