title: Calling function recursively at regular intervals
body: <p>So I was wondering what is a better way (in terms of stack growth and performance) to recursively call a function at regular intervals?
  For example, lets say I want to read file contents every 200 ms. I have the following two methods and was wondering if they are any different?</p>
  
  <p>Method 1: Using plain ols setTimeout without process.nextTick</p>
  
  <pre><code>var fs = require('fs');
  (function loop() {
    // Print to time to indicate something is happening
    console.log(new Date().toString());
  
    // Read a 51MB file
    fs.readFile('./testfile', function (err, data) {
      if (err) console.log(err);
    });
  
    // Call the same function again
    setTimeout(function () {
      loop();
    }, 200);
  })();
  </code></pre>
  
  <p>Method 2: Calling process.nextTick inside setTimeout</p>
  
  <pre><code>var fs = require('fs');
  (function loop() {
    // Print to time to indicate something is happening
    console.log(new Date().toString());
  
    // Read a 51MB file
    fs.readFile('./testfile', function (err, data) {
      if (err) console.log(err);
    });
  
    // Call the same function again
    setTimeout(function () {
      process.nextTick(function () {
        loop();
      });
    }, 200);
  })();
  </code></pre>
  
  <p>What I want to know is that adding process.nextTick inside setTimeout helps or not? Will calling the function inside process.nextTick will alleviate the stack usage or not?</p>