Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.org!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: Dr J R Stockton Newsgroups: comp.lang.javascript Subject: Re: Getting Intermediate Results Reported Right Away Date: Thu, 1 Dec 2011 18:27:01 +0000 Organization: Home Lines: 39 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain;charset=us-ascii Injection-Info: mx04.eternal-september.org; posting-host="UwYDIHu13GPq28RciNoAJA"; logging-data="28564"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18pX+jZ9DsPp6vT4YDBz3ZGl9uC/Gi5iac=" User-Agent: Turnpike/6.05-S () Cancel-Lock: sha1:CYZvqDRjTpR+CMkNDOsgbuMSShA= Xref: x330-a1.tempe.blueboxinc.net comp.lang.javascript:8757 In comp.lang.javascript message , Wed, 30 Nov 2011 15:10:23, Gene Wirchenko posted: > I sometimes want to run something for quite some time. An >example is when I am checking system limits, but later, it could be >something such as processing transactions. > > I could let it run blind, but especially when testing, that is >not a good idea. I could put alert()s in, but then I get interrupted >by them. I would like to be able to start whatever it is going and >watch (or not). > > How can I simply have JavaScript report as it is executing? Like: > 100 things done > 200 things done > 300 things done Choose a browser in which window.status displays, or can be set to, an updating status line or part-line while code is running. IE8, Opera 11.52, Safari 5.1.1, for example. Test : for (J=0 ; J<1e6; J++) if (!(J%1e5)) window.status = J Choose a browser in which the screen, or a certain element, updates, or can be set to, a line while code is running. Testing is easy enough. You may cover more browsers by setting both of the above. TIEE. Run your code 100 things at a time, with the end of a block writing the status to something and starting the next block after a short timeout which will allow redraw. You have already been told how to do that. -- (c) John Stockton, nr London UK ?@merlyn.demon.co.uk IE8 FF8 Op11 Sf5 Cr15 news:comp.lang.javascript FAQ . jscr maths, dates, sources. TP/BP/Delphi/jscr/&c, FAQ items, links.