On Fri, Apr 6, 2012 at 2:38 PM, Mark Hahn <[email protected]> wrote: > How much processing are you doing in a loop? Usually the time to do normal > processing tasks if fine in one tick. The classic example of taking to long > is calculating a Fibonacci series. > > In any case, here is a loop that runs until cond is true ... > > function processOneTick() { > // do work for one tick > if (!cond) setTimeout processOneTick, 0 > } > processOneTick()
I haven't decided yet. I'm basically just trying to understand how to deal with the user code loop so that the ASYNC I/O event won't be interfered with but the user code still gets processed. Basically I was thinking process a line of user code (interpret & process the line), wait some time, next line of user code. Where in the end the loop would be run n times/second. Something similar to Mr. House and Perl (which is pretty much synchronous). I'm not used to doing ASYNC in this manner. -- Neil Cherry Linux Home Automation ( http://www.linuxha.com/ ) Author: Linux Smart Homes For Dummies ( http://linuxha.com/FD/book/index.html ) -- 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 [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/nodejs?hl=en?hl=en
