Effection Logo

function sleepthefrontside/effection

function sleep(duration: number): Operation<void>

Sleep for the given amount of milliseconds.

Examples

Example 1

import { main, sleep } from 'effection';

await main(function*() {
  yield* sleep(2000);
  console.log("Hello lazy world!");
});

Parameters

duration: number

  • the number of milliseconds to sleep

Return Type

Operation<void>