Home > @cascadiacollections/fluentui-compat > Async > setTimeout
Async.setTimeout() method
High-performance setTimeout implementation with automatic cleanup and memory pooling.
Provides the same API as the native setTimeout but with enhanced memory management and automatic cleanup when the Async instance is disposed.
Signature:
setTimeout(callback: () => void, duration: number): number;
Parameters
|
Parameter |
Type |
Description |
|---|---|---|
|
callback |
() => void |
Function to execute after the specified delay |
|
duration |
number |
Delay in milliseconds before executing the callback |
Returns:
number
Timer ID that can be used with clearTimeout