title: javascript run a function every quarter hour at 00, 15, 30 ,45
body: <p>I have the following code taken from stack overflow:</p>
  
  <pre><code>   function doSomething() {
         var d = new Date(),
         h = new Date(d.getFullYear(), d.getMonth(), d.getDate(), d.getHours() + 1, 0, 0, 0),
         e = h - d;
         window.setTimeout(doSomething, e);
  
         //code to be run
         alert("On the hour")
      }
      doSomething(); 
  </code></pre>
  
  <p>This works perfectly and produces an alert every hour on the hour. 
  I would like the function to run every 15 minutes, at 00, 15, 30 and 45</p>