MCPcopy Create free account
hub / github.com/Effect-TS/effect / sleep

Function sleep

packages/effect/src/Micro.ts:3169–3177  ·  view source on GitHub ↗
(millis: number)

Source from the content-addressed store, hash-verified

3167 * @category delays & timeouts
3168 */
3169export const sleep = (millis: number): Micro<void> =>
3170 async((resume) => {
3171 const timeout = setTimeout(() => {
3172 resume(void_)
3173 }, millis)
3174 return sync(() => {
3175 clearTimeout(timeout)
3176 })
3177 })
3178
3179/**
3180 * Returns an effect that will delay the execution of this effect by the

Callers 1

Micro.tsFile · 0.70

Calls 3

asyncFunction · 0.85
resumeFunction · 0.70
syncFunction · 0.50

Tested by

no test coverage detected