ThreadDelay — Delay This thread

ThreadDelay
retcode
reascode
interval

Purpose

Use the ThreadDelay function to delay the invoking thread for the interval specified. The time interval is specified in 4 bytes of milliseconds.

Parameters

retcode
(output,INT,4) is a variable where the function stores the return code.
reascode
(output,INT,4) is a variable where the function stores the reason code.
interval
(input,INT,4) is a variable for specifying the length of the interval, in milliseconds, that the thread is to be delayed. The interval must be greater than zero.

Usage Notes

  1. All delayed threads in a process are awakened by the invocation of TimerStopAll.
  2. A timer that is set for an extremely small interval (small enough to possibly expire before the start processing is complete) could produce unpredictable results.

Return Codes and Reason Codes

Return Code Reason Code Meaning
vm_pro_success vm_pro_success ThreadDelay completed successfully
vm_pro_error vm_pro_interval_invalid Invalid interval specification
vm_pro_error vm_pro_out_of_storage Out of storage

Programming Language Bindings

Language Language Binding File
C VMCPRO H
Assembler VMASMPRO MACRO
REXX VMREXPRO COPY