• Blog
  • Changelog
  • Follow us on GitHubFollow us on XJoin our Discord server
  • Blog
  • GitHub
  • Releases
  • Getting started

    • Overview
  • Library

    • Getting started
    • Array
    • Result
    • Dependency injection
    • Resource management
    • Task
    • Type
    • Conventions
  • Local-first

    • Getting started
    • Playgrounds
    • Examples
    • Owners
    • Relay
    • Migrations
    • Time travel
    • Indexes
    • Protocol
    • Privacy
    • FAQ
  • Other

    • API reference
    • Comparison
    • Showcase
    • Changelog

API reference › @evolu/common › Task › sleep

function sleep(duration: Duration): Task<void>;

Defined in: packages/common/src/Task.ts:1780

Pauses execution for a specified duration.

Example

const task: Task<void> = async (run) => {
  console.log("Starting...");
  await run(sleep("1s"));
  console.log("Done after 1 second");
  return ok();
};
Markdown for LLMs

© 2026 Evolu

Follow us on GitHubFollow us on XJoin our Discord server