The HANG command suspends GT.M program execution for a period of time specified by the command argument.
The format of the HANG command is:
H[ANG][:tvexpr] numexpr[,...]
The optional truth-valued expression immediately following the command is a command postconditional that controls whether or not GT.M executes the command.
The numeric expression specifies the time in seconds to elapse before resuming execution; actual elapsed time may vary slightly from the specified time. If the numeric expression is negative, HANG has no effect. Portability requirements for GT.M only guarantee accuracy to the nearest second. However, more accuracy can be found on VMS systems.
An indirection operator and an expression atom evaluating to a list of one or more HANG arguments form a legal argument to a HANG.
A process that repeatedly tests for some event, such as a device becoming available or another process modifying a global variable, may use a HANG to limit its consumption of computing resources.
Because HALT and HANG share the same abbreviation (H), GT.M differentiates them based on whether an argument follows the command.