title: setInterval runs node function once and continues to run but does not run function
body: <p>I have a node process running that calls a node module</p>
  
  <pre><code>var monitor = require('./monitor.js');
  
  var monitorInterval = setInterval(function () {
      monitor();
      console.log('running monitor')
  }, 10000);
  </code></pre>
  
  <p>The first time this runs the monitor module but it then seems to run the interval but not the function on each subsequent 10s interval. The logs look like this.</p>
  
  <pre><code>MONITOR PROCESS STARTING
  running monitor
  running monitor
  database connected
  database connected
  etc...
  
  running monitor
  running monitor
  
  running monitor
  running monitor
  &lt;10s PASS AND MONITOR DOES NOT RUN HERE&gt;
  
  running monitor
  running monitor
  &lt;10s PASS MONITOR DOES NOT RUN HERE&gt;
  </code></pre>
  
  <p>So why is this? Could it be because the JS engine is not idle? I'm pretty sure it is doing nothing during subsequent intervals.</p>
  
  <p>Monitor is initialized as follows:</p>
  
  <pre><code>function Monitor() {
      this._initialize();
  }
  
  module.exports = function (cb) {
      if (monitor === null) {
          monitor = new Monitor();
      }
  };
  
  Monitor.prototype = {
  
      _initialize: function () {
          console.log('MONITOR PROCESS STARTING');
          var monitor = this;
  //etc
      }
  }
  </code></pre>