Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #8757

Re: Getting Intermediate Results Reported Right Away

From Dr J R Stockton <reply1148@merlyn.demon.co.uk>
Newsgroups comp.lang.javascript
Subject Re: Getting Intermediate Results Reported Right Away
Date 2011-12-01 18:27 +0000
Organization Home
Message-ID <OuWMS7D1b81OFwJL@invalid.uk.co.demon.merlyn.invalid> (permalink)
References <hmddd7litkuobgpjdpstl6hav6clkhr0bl@4ax.com>

Show all headers | View raw


In comp.lang.javascript message <hmddd7litkuobgpjdpstl6hav6clkhr0bl@4ax.
com>, Wed, 30 Nov 2011 15:10:23, Gene Wirchenko <genew@ocis.net> 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 <http://www.jibbering.com/faq/index.html>.
   <http://www.merlyn.demon.co.uk/js-index.htm> jscr maths, dates, sources.
   <http://www.merlyn.demon.co.uk/> TP/BP/Delphi/jscr/&c, FAQ items, links.

Back to comp.lang.javascript | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Getting Intermediate Results Reported Right Away Gene Wirchenko <genew@ocis.net> - 2011-11-30 15:10 -0800
  Re: Getting Intermediate Results Reported Right Away Andreas Bergmaier <andber93@web.de> - 2011-12-01 00:20 +0100
  Re: Getting Intermediate Results Reported Right Away Tim Streater <timstreater@greenbee.net> - 2011-12-01 00:07 +0000
  Re: Getting Intermediate Results Reported Right Away Hans-Georg Michna <hans-georgNoEmailPlease@michna.com> - 2011-12-01 15:55 +0100
    Re: Getting Intermediate Results Reported Right Away Gene Wirchenko <genew@ocis.net> - 2011-12-01 12:09 -0800
      Re: Getting Intermediate Results Reported Right Away Denis McMahon <denismfmcmahon@gmail.com> - 2011-12-01 21:33 +0000
        Re: Getting Intermediate Results Reported Right Away Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2011-12-02 00:12 +0100
  Re: Getting Intermediate Results Reported Right Away Dr J R Stockton <reply1148@merlyn.demon.co.uk> - 2011-12-01 18:27 +0000

csiph-web