Oh cool! and I found setTimeout(console.log, 1000, 'hello world')
is much better than setTimeout(function(){ console.log('hello world'); }, 1000) 在 2012年4月23日 下午2:32,Joran Greef <jo...@ronomon.com>写道: > If you pass a function reference to an existing function to setTimeout, > and then call this function repeatedly, rather than creating a closure each > setTimeout call, that will lower your memory and cpu overhead substantially. > > > On Monday, April 23, 2012 7:49:08 AM UTC+2, Jason.桂林 wrote: >> >> I need to write a service use something like in memory cache, and I want >> to do `expire` things in setTimeout, will it very slow, If I expire too >> much things, about kilos to millions. >> >> -- >> Best regards, >> >> Jason Green >> 桂林 >> >> >> -- > Job Board: http://jobs.nodejs.org/ > Posting guidelines: > https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines > You received this message because you are subscribed to the Google > Groups "nodejs" group. > To post to this group, send email to nodejs@googlegroups.com > To unsubscribe from this group, send email to > nodejs+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/nodejs?hl=en?hl=en > -- Best regards, Jason Green 桂林 -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this message because you are subscribed to the Google Groups "nodejs" group. To post to this group, send email to nodejs@googlegroups.com To unsubscribe from this group, send email to nodejs+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/nodejs?hl=en?hl=en