Skip to content

Instantly share code, notes, and snippets.

@LesTR
Last active August 29, 2015 14:05
Show Gist options
  • Save LesTR/a231149eb26c2da92ee5 to your computer and use it in GitHub Desktop.
Save LesTR/a231149eb26c2da92ee5 to your computer and use it in GitHub Desktop.
(function () {
"use strict";
var fs = require('fs'),
iterations = 0,
work = function (callback) {
var buffer = '',
i;
console.log('Work ' + iterations);
for (i = 0; i < 50; i += 1) {
buffer += fs.readFileSync('/usr/share/dict/words');
}
iterations += 1;
if (iterations < 100) {
// buffer = null;
// process.nextTick(function () {
work(callback);
// });
} else {
callback();
}
};
work(function () {
console.log('Done');
});
}());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment