Re: repeated XMLHttpRequest GETs and displaying result
In comp.lang.javas cript message <g416ql$c4e$1$8 300dec7@news.de mon.co.uk>
, Thu, 26 Jun 2008 23:56:16, Richard Cornford
<Richard@litote s.demon.co.ukpo sted:
>
>Is there any point in a CPU spinning its wheels more efficiently?
A shorter algorithm, where it works as well or better, is always an
improvement. This one illustrates the point that no work that can be
done outside a loop should be done within it (and unary +).
If you still have access to the FAQ, how about correcting Section 5?
--
(c) John Stockton, nr London UK. ?@merlyn.demon. co.uk IE7 FF2 Op9 Sf3
news:comp.lang. javascript FAQ <URL:http://www.jibbering.c om/faq/index.html>.
<URL:http://www.merlyn.demo n.co.uk/js-index.htmjscr maths, dates, sources.
<URL:http://www.merlyn.demo n.co.uk/TP/BP/Delphi/jscr/&c, FAQ items, links.
In comp.lang.javas cript message <g416ql$c4e$1$8 300dec7@news.de mon.co.uk>
, Thu, 26 Jun 2008 23:56:16, Richard Cornford
<Richard@litote s.demon.co.ukpo sted:
> That undesirable routine would be more efficiently written as
> function dopause(msecs) { var done = +new Date() + msecs;
> while (new Date() < done) {} }
> function dopause(msecs) { var done = +new Date() + msecs;
> while (new Date() < done) {} }
>Is there any point in a CPU spinning its wheels more efficiently?
improvement. This one illustrates the point that no work that can be
done outside a loop should be done within it (and unary +).
If you still have access to the FAQ, how about correcting Section 5?
--
(c) John Stockton, nr London UK. ?@merlyn.demon. co.uk IE7 FF2 Op9 Sf3
news:comp.lang. javascript FAQ <URL:http://www.jibbering.c om/faq/index.html>.
<URL:http://www.merlyn.demo n.co.uk/js-index.htmjscr maths, dates, sources.
<URL:http://www.merlyn.demo n.co.uk/TP/BP/Delphi/jscr/&c, FAQ items, links.
Comment