본문으로 건너뛰기

sleep

Promise를 이용한 수면 기능.

Parameters

이름타입필수기본값
millisecondsnumberint

Returns

Promise<void>

Future<void>

None

Examples

javascript
await sleep(1000); // 1s

sleep(5000).then(() => {
	// continue
});
dart
await sleep(1000); // 1s

sleep(5000).then(() => {
// continue
});
python
sleep(1000)  # 1s (blocks synchronously)

sleep(5000)
# continue

Released under the MIT License