tinybench - v6.0.0-rc.1
    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

    Properties

    afterAll?: FnHook

    An optional function that is run after all iterations of this task end

    afterEach?: FnHook

    An optional function that is run after each iteration of this task

    async?: boolean

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

    beforeAll?: FnHook

    An optional function that is run before iterations of this task begin

    beforeEach?: FnHook

    An optional function that is run before each iteration of this task

    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