The amount of time to wait, in seconds. This time can be expressed as any numeric expression. You can specify hangtime as an integer to specify whole seconds, or as fractional number to specify fractional seconds. You can use exponentiation (**), arithmetic expressions, and other numeric operators.
You can set hangtime to 0 (zero), in which case no hang is performed. Setting hangtime to a negative number or a nonnumeric value is the same as setting it to 0.
You can specify multiple hangtime arguments as a comma-separated list of numeric expressions. InterSystems IRIS suspends execution for the duration of each argument in the order presented. Negative numbers are treated as zero. Therefore, a hangtime of 16,-15 would hang for 16 seconds.
That each hangtime argument is separately executed can affect operations that use the current time in hang calculations, as shown in the following example:
WRITE !,"elapsed hang=",end-start
In this example, HANG first suspends execution for 4 seconds. When the next argument is parsed, the current time is now 4 seconds after the variable was set, so the second suspension is only for 1 second. Because HANG executes each argument in turn, the total hang time in this example is (roughly) 5 seconds, rather than the (roughly) 9 seconds one might otherwise expect.