after (GCL TK Manual)

Next: bind, Previous: Control, Up: Control [Contents]

### 3.1 after

after - Execute a command after a time delay

#### Synopsis

after ms ?arg1 arg2 arg3 ...?

#### Description

This command is used to delay execution of the program or to execute a command in background after a delay. The ms argument gives a time in milliseconds. If ms is the only argument to after then the command sleeps for ms milliseconds and returns. While the command is sleeping the application does not respond to X events and other events.

If additional arguments are present after ms, then a Tcl command is formed by concatenating all the additional arguments in the same fashion as the concat command. After returns immediately but arranges for the command to be executed ms milliseconds later in background. The command will be executed at global level (outside the context of any Tcl procedure). If an error occurs while executing the delayed command then the tkerror mechanism is used to report the error.

The after command always returns an empty string.

See tkerror.

#### Keywords

delay, sleep, time