Timeout¶
Executes the given callback function at maximum in the given milliseconds.
1 |
|
Parameters¶
() => void fn
The callback to execute.
number milliseconds
The maximum milliseconds to execute the callback.
Remarks¶
When function completed in the given milliseconds, the function returns the callback result, otherwise returns null.
Example¶
1 2 3 4 |
|