tinybench - v4.0.1
    Preparing search index...

    Interface BenchOptions

    bench options

    interface BenchOptions {
        iterations?: number;
        name?: string;
        now?: () => number;
        setup?: Hook;
        signal?: AbortSignal;
        teardown?: Hook;
        throws?: boolean;
        time?: number;
        warmup?: boolean;
        warmupIterations?: number;
        warmupTime?: number;
    }
    Index

    Properties

    iterations?: number

    number of times that a task should run if even the time option is finished

    64
    
    name?: string

    benchmark name

    now?: () => number

    function to get the current timestamp in milliseconds

    setup?: Hook

    setup function to run before each benchmark task (cycle)

    signal?: AbortSignal

    An AbortSignal for aborting the benchmark

    teardown?: Hook

    teardown function to run after each benchmark task (cycle)

    throws?: boolean

    Throws if a task fails

    false
    
    time?: number

    time needed for running a benchmark task (milliseconds)

    1000
    
    warmup?: boolean

    warmup benchmark

    true
    
    warmupIterations?: number

    warmup iterations

    16
    
    warmupTime?: number

    warmup time (milliseconds)

    250