DELAY

5/10/2007

This command suspends the execution of the current thread for the specified interval.

Syntax

2, [ErrorMode], [Timeout], [Jitter]

Parameters

  • ErrorMode
    Optional. Specified as a decimal representation of a hexadecimal bitmask. Values must be specified in decimal format. The following table shows the possible values.

    Value Name Description

    0 (0xnnnn0000)

    DAERH_ABORT

    Default. The abort-on-error mode stops the command file from processing further.

    32768 (0xnnnn8000)

    DAERH_IGNORE

    The ignore-on-error mode continues by processing the next command when an error occurs.

    32769-33023 (0x000080xx where xx!=00 is the number of retries)

    DAERH_RETRY_WITHIGNORE

    The retry-on-error with ignore mode retries the offending command up to 255 times. If the number of retries exceeds the retry count, this mode continues processing the next command.

    1-255(0x00xx where xx!=0 is the number of retries from 1-255)

    DAERH_RETRY_WITHABORT

    The retry-on-error with abort mode retries the offending command up to 255 times. If the number of retries exceeds the retry count, the command file processing halts.

    65536 – 4294901760(0xFFFFnnnn where FFFF is the delay mask in seconds)

    DAERH_DELAYMASK

    The delay error mode value is added to either the DAERH_RETRY_WITHIGNORE or the DAERH_RETRY_WITHABORT value to cause a delay between retries. This value is in seconds and has a range between 1 and 65535.

    Note

    Parsing errors, especially the passing of not valid command parameters, generates an error in DAERH_ABORT error mode. With logging enabled, an appropriate error message is output to the log file.

  • Timeout
    Optional. Specifies the time, in seconds, for which to suspend execution. The following table shows the possible values.

    Value Description

    0 thru 1000

    Specifies the time, in seconds, for which to suspend execution. A value of zero causes the thread to relinquish the remainder of its time slice to any other thread of equal priority that is ready to run. If there is no other thread of equal priority ready to run, the function returns immediately, and the thread continues execution. Default value is 0.

  • Jitter
    Optional. Specifies the timeout jitter range in seconds. The following table shows the possible values.

    Value Description

    0 thru 65535

    Specifies the timeout jitter range in seconds. The jitter randomizes a positive or negative delta in seconds relative to the timeout. Default value is 0.

Remarks

For more information, see the Microsoft Windows SDK documentation at this Microsoft Web site.

Example

The following example shows typical use.

//
// Delay: Delay script execution for 5 seconds.
//
DELAY,,5

See Also

Concepts

DUA Script Command Reference