faqts : Computers : Programming : Languages : JavaScript : DHTML

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

12 of 15 people (80%) answered Yes
Recently 3 of 5 people (60%) answered Yes

Entry

Is there a way of keeping resource intensive operations from consuming the entire CPU? Can you manage script threads and memory from within a script?

Feb 15th, 2009 21:39
Inschi jelii, Martin Honnen, U I,


When doing animations don't use simple loops but
  setInterval('your code to be repeated here', delayInMilliSeconds)
You can also build functions which recursively call themselves not 
directly but using
  setTimeout('functionCall()', delayInMilliseconds)
to give other computations time to be executed/continued.
Check many of the dhtml examples in this section and you find examples 
where these techniques are applied.
http://lahjatideoita.blogspot.com
http://ideaspara-regalar.blogspot.com
http://idearegalo1.blogspot.com
http://geschenkeidee.blogspot.com
http://darkovenapady.blogspot.com