Dr J R Stockton
5/8/2016 6:19:00 PM
In comp.lang.javascript message <2597183.QcWBBMbo8E@PointedEars.de>,
Sat, 7 May 2016 22:51:48, Thomas 'PointedEars' Lahn <PointedEars@web.de>
posted:
>> In situations where I DID want the document to update immediately I had to
>> use a short setTimeout to pause execution.
>
>Still true, except that window.setTimeout() has never paused execution (that
>is a common misconception). Instead, code that is to run independent of
>window updates and would potentially block execution, is to be executed with
>window.setTimeout() or the Web Workers API.
You are, as is customary, unnecessarily pedantic whenever that enables
you to avoid being helpful.
The setTimeout call does not of itself pause execution; but it can be
used to enable execution to restart after it stops for other reasons.
it and setInterval thereby provide /sine qua non/s for the pausing of
execution.
Pseudo-Pascal, as I am not set up to test it now :
function F() ; begin
Write(1) ;
Pause(1000) ;
Write(2)
end ;
Pseudo-JavaScript :
function F() {
Write(1)
setTimeout(G, 1000)
}
function G() :
Write(2)
;
RBTD.
--
(c) John Stockton, Surrey, UK. ¬@merlyn.demon.co.uk Turnpike v6.05 MIME.
Merlyn Web Site < > - FAQish topics, acronyms, & links.