after
after ms ?script ...?
after cancel id|script
after idle script ?script ...?
after info ?id?
With a script, runs it from the event loop after ms milliseconds and gives an id. With no script, waits ms milliseconds. after idle runs the script when the loop has no other work. The script runs at the top level: build it with list. In the shell of the site, the loop runs on a virtual clock, so a wait ends at once.
Examples
after 10 {set ::done 1}; vwait done; set donegives1
Errors
after nopegives the errorbad argument "nope": must be cancel, idle, info, or an integer
Facts
- Capability:
event. A new interpreter does not have this command. See Limits and capabilities. - Compute cost: one compute unit for the call, and more for the commands that it runs.