Potentially outdated documentation
You're reading API reference for version 3.0.3. The latest stable release is version 3.1.0.
function sleep
thefrontside/effectionfunction 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>