Skip to content

sleep

Asynchronously wait for time to pass

73 bytes

Usage

The _.sleep function allows you to delay in milliseconds.

import * as
import _
_
from 'radashi'
await
import _
_
.
function sleep(milliseconds: number): Promise<void>
export sleep

Create a promise that resolves after a given amount of time.

@seehttps://radashi.js.org/reference/async/sleep

@example

await sleep(1000)

@version12.1.0

sleep
(2000) // => waits 2 seconds