thread.sleep

Syntax thread.sleep (id)

Params id is the numeric id of the thread that you wish to put to sleep.

Action Puts the indicated thread to sleep.

Returns True (when the thread wakes up).

Examples thread.sleep (117) // put the thread to sleep

   » true

thread.sleep (thread.getNthID (1)) // put the agent thread to sleep

   » true

Errors It is an error to specify a nonexistent thread id.

Notes The thread that you put to sleep with this verb will remain asleep forever, until another thread wakes it up with thread.wake, or terminates it with thread.kill.

To put the current thread to sleep, it usually makes more sense to call thread.sleepFor.

This verb will return true even if the thread is already asleep.

It is usually not a good idea to call this verb from an agent script; all other agents run in the same thread, and thus will not run until the thread is awakened.

See Also thread.getNthID

thread.sleepFor

system.compiler.threads

Discuss