sleep
Callable
Parameters
optionalmillis: number
Period of time to sleep, in milliseconds. If not a positive number, the returned promise resolves immediately.
Returns Promise<void>
Period of time to sleep, in milliseconds. If not a positive number, the returned promise resolves immediately.
Returns a
Promise
that resolves after a specific period of time. This is useful to implement waiting in your code, e.g. to prevent overloading of target website or to avoid bot detection.Example usage: