Hi Eric, The doSomething was just a pseudo code example;) Nevertheless, it really does not matter if it takes a long time (if it is a really computing intensive task, it should be carried over to a web-worker!) Both the timeout and the asynceval set it to execute at a later time, but both do execute it, so there is no performance gain from either method. Both will add it at the end of the execution-chain. For performance (in a click handler!) its even better to not do a timeout/asynceval, as this is marginally adding load to the task. Either way, its hogging the execution-chain. All javascript will be executed before the next event gets processed. There is no escape from that. (well, other than the earlier named web-workers!) Usually one does not need to worry about those issues, Javascript is really fast nowadays. Unless traversing large amounts of data/DOM, performance is seldom an issue!
Regards Sander -- You received this message because you are subscribed to the Google Groups "AngularJS" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/angular. For more options, visit https://groups.google.com/d/optout.
