-
-
Save Raynos/c9b67658a7b89bfe7484 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var setTimeout = require('timers').setTimeout; | |
var work = 0; | |
console.log('version: ' + process.version); | |
if (typeof gc === 'undefined') { | |
throw new Error('run node foo.js --expose-gc'); | |
} | |
setTimeout(function loop() { | |
gc(); | |
var timer = setTimeout(function () { | |
work += 1; | |
loop(); | |
}, 10); | |
timer.unref(); | |
}, 10); | |
(function keepalive() { | |
setTimeout(function () { keepalive(); }, 1000000000); | |
}()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment