Milliseconds

Waits the specified number of milliseconds and returns the value of the millisecond timer.

1378

Inputs/Outputs

datatype_icon

milliseconds to wait

Number of milliseconds to wait.

Wiring a value of 0 to this input forces the execution system to check for other available code to execute.

Maximum Input before Timer Wrap-Around

If the wait time you specify is greater than the maximum allowed for the Counter size of the Wait node, the expected program wait time wraps around and starts again from zero. You can configure the Counter size of the node in the Item tab.

datatype_icon

millisecond timer value

Value of the operating system's millisecond timer after the wait.

Programming Patterns

  • Adjusting the Execution Speed of a Loop

Timer Accuracy

The accuracy of the timer varies across operating systems. If the operating system takes more time to process a request than the time that the input specifies, the actual wait time is longer than the time that the input specifies.

When to Use Wait Until Next Multiple instead of Wait

If you need to ensure that an operation waits at least the specified time before completing execution, you can use either a Wait node or a Wait Until Next Multiple node. However, for functions that feedback an output as an input and require consistent timing between iterations to achieve equilibrium, such as a PID node in a loop, use a Wait Until Next Multiple node. Compared to Wait nodes, Wait Until Next Multiple nodes have more periodic spacing between iterations, because even if one iteration finishes late, the following iteration still executes on the multiple of the Wait Until Next Multiple input.

Thread Availability During Wait Time

When an active execution system thread in a program reaches a Wait node in the millisecond configuration, the node execution is rescheduled cooperatively and the temporarily available thread is used by any other currently executing code until the wait time expires.

When you use the microsecond or tick configuration of this node, the thread which encounters the Wait node is blocked until the wait time expires.