469,308 Members | 2,737 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,308 developers. It's quick & easy.

Sleep function in JavaScript

Is there a method to put a javascript thread to sleep for a few milliseconds? This would allow for a something to move across the screen on a thread, while still allowing for other actions within the browser to work. I know setInterval can work, but it requires relaunching the functions and writing the values as a global dataset. I would like to know if there is a simple way, that when the action starts, I can pause it without having to create loops or globals.

Thanks,
Leo
Nov 19 '07 #1
1 1561
gits
5,390 Expert Mod 4TB
hi ...

you may have a look at the:

Expand|Select|Wrap|Line Numbers
  1. window.setTimeout(funcref, milliseconds);
  2.  
method.

kind regards
Nov 19 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

4 posts views Thread by Xaradas | last post: by
4 posts views Thread by coolsti | last post: by
4 posts views Thread by Alexander Erlich | last post: by
6 posts views Thread by M B HONG 20 | last post: by
10 posts views Thread by Alfonso Morra | last post: by
5 posts views Thread by Sinan Nalkaya | last post: by
reply views Thread by Tim Golden | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by harlem98 | last post: by
1 post views Thread by Geralt96 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.