This is a timer object, but clears it as you expected:
$ node. / test.js
var id = setInterval(function(){ console.log("FOO"); console.log(id); }, 500); setTimeout(function(){ clearInterval(id); }, 5000);
Displays the following data for 5 seconds and clears as expected:
FOO { repeat: 0, callback: [Function] } FOO { repeat: 0, callback: [Function] } FOO { repeat: 0, callback: [Function] }
Additional information: http://nodejs.org/docs/v0.5.10/api/timers.html
chovy source share