SetInterval is hogging up resources- alternatives the Node.js way -


below simple function reports time system resources 100 times second:

var util = require('util');  function report(){     console.log(new date());     console.log(util.inspect(process.memoryusage())); }  setinterval(report,10); 

sure, example isn't practical- more illustrative purposes

it works- memory allocation goes up , , up. understanding, isn't memory leak- rather natural behavior of javascript. due function, or record of performed functions being added heap every time setinterval called. , long process alive.

so here's question:

is there better way achieve same output, more efficiently?


Comments

Popular posts from this blog

ios - iPhone/iPad different view orientations in different views , and apple approval process -

php - HTTP_REFERER woes: How can I allow access to a specific page, only when a visitor has visited another specific page beforehand? -

java Extracting Zip file -