tinybench - v6.2.0
    Preparing search index...

    Interface FnOptions

    The task function options

    interface FnOptions {
        afterAll?: FnHook;
        afterEach?: FnHook;
        async?: boolean;
        beforeAll?: FnHook;
        beforeEach?: FnHook;
        retainSamples?: boolean;
        signal?: AbortSignal;
    }
    Index
    afterAll?: FnHook

    Runs once after all iterations of a task phase (warmup or run).

    afterEach?: FnHook

    Runs after each iteration in both warmup and run phases.

    async?: boolean

    Whether the provided task function is asynchronous, otherwise it is determined automatically.

    Measuring an async task awaits it inside the timed window, so each sample includes one microtask-turn overhead that subtractTimerOverhead does not remove. For sub-resolution timings, prefer overriddenDuration.

    beforeAll?: FnHook

    Runs once before the iterations of a task phase (warmup or run).

    beforeEach?: FnHook

    Runs before each iteration in both warmup and run phases.

    retainSamples?: boolean

    Retain samples for this task, overriding the bench-level retainSamples option

    signal?: AbortSignal

    An AbortSignal for aborting this specific task

    If not provided, falls back to BenchOptions.signal