473,407 Members | 2,315 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

when does settimeout execute the delayed code?

Hi,

setTimeout(code, delay)

When the delay of a setTimeout expires it is time to execute the code.
If the browser is executing some other JavaScript will the setTimeout
code interupt or wait until the browser is not busy doing other things?
(Can the browser execute mutliple threads?)

Thanks,
Peter

Jun 2 '06 #1
1 1392
0p***********@gmail.com wrote:
setTimeout(code, delay)

When the delay of a setTimeout expires it is time to
execute the code.
If the browser is executing some other JavaScript will
the setTimeout code interupt or wait
Wait.
until the browser is not busy doing other
things?
More or less, depending on the browser.
(Can the browser execute mutliple threads?)


A single browser window/ECMAScript global environment cannot execute
multiple threads (javascript is not multi-threaded). It may be possible
for different frames to act as different browsers and so be executing
script in one frame at the same time as executing script in another.
There is no evidence that current browsers do so.

Richard.
Jun 2 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Raphael Bauduin | last post by:
Hi, I'm working with mozilla, building a little XUL app. I have a datasource, and want to display a message once it is loaded (datasource.loaded is true). So, I thought to use timouts, but as...
1
by: Noh Way | last post by:
I have a stack of DOM elements and I have stored their IDs in an array. I want to press a button - this code is from that button's event's function- and have a slideshow as each element is brought...
18
by: Frances Del Rio | last post by:
this code is supposed to flip imgs at intervals of one second, but it flipps them much faster, it seems it flips them all in that first second, the more seconds the faster it flips them, instead of...
4
by: nntp | last post by:
<a id="hiddenLink1" name="hiddenLink1" href="page1.htm" target="someTarget1" >1 </a> <a id="hiddenLink2" name="hiddenLink2" href="page2.htm" target="someTarget1" >2 </a> <A...
2
by: Rob Nicholson | last post by:
How does setTimeout work? If the user moves the mouse or types some text into a form, does it reset the timer? Or does it start running when first triggered and simply timeout after that amount of...
10
by: samuelberthelot | last post by:
Hi, I have the following code that shows up a div with an animated gif inside, executes a cpu intensive function using setTimeout and then hide the div again: getEl('divWaiting').style.display...
3
by: Darren.Ratcliffe | last post by:
Hi The below pasted code is my attempt to get the text of a span to change every second. However, it seems to just set the text of the span to be the last item in the array. Can anybody...
15
by: nikki_herring | last post by:
I am using setTimeout( ) to continuously call a function that randomly rotates/displays 2 images on a page. The part I need help with is the second image should rotate 3 seconds after the first...
5
by: Gretsch | last post by:
Hi, Can someone help me with the command format please. I have a function (called fade) that was 3 parameters: the first 2 are colours therefore formatted #123456 and the 3rd is a number of...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.