Forum OpenACS Q&A: How to Make TCL take a NAP

Collapse
Posted by MaineBob OConnor on

I need a function to STOP my script for a period of time, do nothing and then continue.

So I went to:
http://www.tcl.tk/man/tcl8.2.3/TclLib/Sleep.htm
And I found a function:

Tcl_Sleep - delay execution for a given number of milliseconds

But this does not work in AOLserver/3.3.1+ad13 run with nsd8x. I get a:

Error: invalid command name "tcl_sleep"

So, is there an alternative to perhaps upgrading to a newer version of aolserver? Any issues with running this version (or any version you may suggest of a wait inside a loop?

THANK YOU!

-Bob

Collapse
Posted by Jonathan Ellis on
Tcl_Sleep is a function you'd call from C

sleep is the tcl function, but it takes its argument in seconds, not  ms.

Collapse
Posted by Tom Jackson on

Try:

ns_sleep 5
Collapse
Posted by russ m on
to specify a ms-resolution delay use [after ms]

http://tcl.activestate.com/man/tcl8.3/TclCmd/after.htm

"yay" for intuitive function naming...