Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Is it possible to release CPU while in javascript loop?

Status
Not open for further replies.

awolff01

Programmer
Jun 17, 2003
55
0
0
US
Hello,

I am wondering if there is a function that releases the CPU to do other stuff while my javascript program is executing within a loop?

I guess what I am looking for is something similar to the
"DoEvents" function in Visual Basic which releases the CPU to take care of other queued request.

DoEvents is a Visual Basic function that yields execution so the operating system can process other events.

Thanks.
 
What are you trying to do that requires such intensive processing power? JavaScript was meant, as that, a scripting language. Are you caught in a loop somewhere (like a for loop without an increment), or a while loop (that never has an "out" case)?

Do you have a code example?

Pete.


Web Developer & Aptrix / Lotus Workplace Web Content Management (LWWCM) Specialist
w: e: Pete.Raleigh(at)lclimited.co.uk
 

I have a similar problem... Traversing recursively through a tree structure of many, many nodes, the screen doesn't update at each node...

I'm guessing I'll have to resort to some sort of setTimeout call, but it's rather klunky ;o(

What about running the DoEvents function in a VBScript tag? Even if that worked in IE only, it'd still be quite good.

Dan


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top