• The delay function creates a promise that will be fulfilled after given time and can be aborted by providing abortSignal.

    Parameters

    • time: TimeSpan
    • abortSignal: AbortSignal = ...

    Returns Promise<void>

    AsyncError

    import { delay, TimeSpan } from "@daiso-tech/core";
    (async () => {
    console.log("a");
    await delay(TimeSpan.fromSeconds(2));
    console.log("b");