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


Groups > comp.lang.javascript > #13983

Re: A kind of flush ?

Newsgroups comp.lang.javascript
Subject Re: A kind of flush ?
From "Evertjan." <exjxw.hannivoort@interxnl.net>
References <4fb17b40$0$6460$426a74cc@news.free.fr> <XnsA054DD5EAA9Eeejj99@194.109.133.133> <4fb21764$0$6832$426a34cc@news.free.fr>
Message-ID <XnsA0547284F6B4eejj99@194.109.133.133> (permalink)
Date 2012-05-15 09:15 +0000

Show all headers | View raw


Olve wrote on 15 mei 2012 in comp.lang.javascript:

> Then it means I haven't understood something.

Indeed, this is not email.
This is is usenet [one-to-many communication], 
so quote the part(s) that you are replying on,

> Here is a code below.
> The first one is with a loop. If you click on Go, you will get the 
> proper message but after the script is exited !

It is not the whole script that should be exited, but the "sub-"function, 
see below and get excited.

[..]
>      <script language="javascript">

is last century's code, use:
    <script type='text/javascript'>

>          while (new Date() < ms){}}

Wow! This is not pausing, you keep the microprocessor running at full 
speed, meaning full speed allowed to this javascript process. You will have 
to set a interrupt and leave the process. That way the dom-process will 
have time to do things, and you are more polite to other processes on your 
pc, like the other running programmes, system clock, sound and light and 
the interrupt mechanism. 

That means you will have to rewrite your code into a whole other setup,
where a function the does a small part of your 'computation' and then ENDS 
after calling setTimeOut();.
After say 20ms the timeout fires [restarts the process] the next instance 
of your function. Between the end and the restart the dom gets time to 
paint the new canvas, as I wrote earlier. 
This goes on till the final result is reached, or a fixed number of 
iterations is reached after which the function does not
reiterate with the next setTimout call but goes to somehere else.

-- 
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

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


Thread

A kind of flush ? Olve <Olve@nowhere.wd.invalid> - 2012-05-14 23:38 +0200
  Re: A kind of flush ? "Evertjan." <exjxw.hannivoort@interxnl.net> - 2012-05-14 23:21 +0000
    Re: A kind of flush ? Olve <Olve@nowhere.wd.invalid> - 2012-05-15 10:44 +0200
      Re: A kind of flush ? "Evertjan." <exjxw.hannivoort@interxnl.net> - 2012-05-15 09:15 +0000
        Re: A kind of flush ? Olve <Olve@nowhere.wd.invalid> - 2012-05-15 11:51 +0200
        Re: A kind of flush ? Olve <Olve@nowhere.wd.invalid> - 2012-05-16 09:16 +0200
  Re: A kind of flush ? Dr J R Stockton <reply1220@merlyn.demon.co.uk.not.invalid> - 2012-05-15 20:22 +0100
    Re: A kind of flush ? Olve <Olve@nowhere.wd.invalid> - 2012-05-16 08:28 +0200
      Re: A kind of flush ? "Evertjan." <exjxw.hannivoort@interxnl.net> - 2012-05-16 15:00 +0000
        Re: A kind of flush ? Swifty <steve.j.swift@gmail.com> - 2012-05-16 17:43 +0100
          Re: A kind of flush ? "Evertjan." <exjxw.hannivoort@interxnl.net> - 2012-05-17 18:47 +0000
            Re: A kind of flush ? Scott Sauyet <scott.sauyet@gmail.com> - 2012-05-17 13:20 -0700
          Re: A kind of flush ? Gene Wirchenko <genew@ocis.net> - 2012-05-17 13:23 -0700

csiph-web