Newer version available
You’re viewing the API reference for version 3.0.3, but the latest version is 3.1.0. The latest version include may important updates and fixes.
View Latest Versionfunction 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>