Delay
This node delays a signal by a specified amount of time.
The Delay node pauses the flow of execution for a set duration.
The Delay node is a simple timer that waits for a specific number of milliseconds after receiving an input signal before emitting an output signal.
Inputs
General
| Data | Description |
|---|---|
| Delay | The wait time in milliseconds. Default: 1000. |
Actions
| Signal | Description |
|---|---|
| In | The signal to delay. |
| Cancel | Cancels any pending delay. |
Outputs
Events
| Signal | Description |
|---|---|
| Out | Triggered after the delay time has passed. |
Usage
Debouncing
(Note: For true debouncing, specialized nodes are better, but Delay can simulate it).
- User types a character.
- Trigger Cancel (to stop previous timer) then In.
- After 500ms of no typing, Out triggers "Search".
Sequence
- Show "Success" message.
- Trigger Delay (2000ms).
- On Out, hide the message.
Detailed Behavior
- Multiple Triggers: If In is triggered multiple times, it creates multiple independent timers (unless canceled).
- Cancellation: Cancel stops all pending timers for this node.
Troubleshooting
- Timing: Delays are not guaranteed to be exact to the millisecond due to JavaScript's event loop, but are generally accurate enough for UI logic.