0

I've read that all browsers except chrome have javascript code running in a single thread. I'm not even sure if this is still true, but assuming it is: Will calling window.setInterval multiple times open multiple threads in chrome?

user1149589
  • 243
  • 3
  • 11

1 Answers1

1

setTimeout and setInterval (spec link) will run code asynchronously, but won't run code on a different thread. It will use main UI thread to run the code you provide after specified period of time. To use multithreading, take a look at HTML5 Web Workers (MSDN) or look at this answer (stackoverflow).

Community
  • 1
  • 1
Eadel
  • 3,797
  • 6
  • 38
  • 43