![]() | |
#1
| |||
| |||
|
#2
| |||
| |||
|
#3
| |||
| |||
|
|
How can I suspend the execution of a script for x seconds? Does exists something like sleep(x)? Thanks. ------------------------------------ "Computer Science is no more about computers than astronomy is about telescopes." ::[E. W. Dijkstra] Posted from X-Privat Free NNTP server - www.x-privat.org |
#4
| |||
| |||
|
|
There may be a way to get around this.... though the only way I can think of off hand is a bit ugly, since it takes _ALL_ of the available processor, which is BAD... but here is the thought: var sleeping = true; setTimeout("sleeping = false", 1000); // 1 second while(sleeping) {} |
|
The best way to have a delay, is to redesign your system to not require a blocking delay, and use the non-blocking setTimeout. |
#5
| |||
| |||
|
|
How can I suspend the execution of a script for x seconds? Does exists something like sleep(x)? Thanks. |
|
Grant Wagner <gwagner (AT) agricoreunited (DOT) com |
![]() |
| Thread Tools | |
| Display Modes | |
| |