bothy-sdk
    Preparing search index...

    Interface Clock

    Wall time for token checks, a monotonic time for waits, and a sleep.

    interface Clock {
        monotonic(): number;
        now(): number;
        sleep(ms: number, signal?: AbortSignal): Promise<void>;
    }

    Implemented by

    Index

    Methods

    • Returns a monotonic time in milliseconds for intervals.

      Returns number

    • Returns the current wall time as Unix milliseconds.

      Returns number

    • Waits for ms milliseconds; zero or negative resolves at the next turn.

      Parameters

      • ms: number

        The wait.

      • Optionalsignal: AbortSignal

        Optional abort signal; an abort rejects with its reason.

      Returns Promise<void>