MCPcopy
hub / github.com/Effect-TS/effect / sleep

Function sleep

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

Source from the content-addressed store, hash-verified

3166 * @category delays & timeouts
3167 */
3168export const sleep = (millis: number): Micro<void> =>
3169 async((resume) => {
3170 const timeout = setTimeout(() => {
3171 resume(void_)
3172 }, millis)
3173 return sync(() => {
3174 clearTimeout(timeout)
3175 })
3176 })
3177
3178/**
3179 * 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