tinybench - v6.2.0
    Preparing search index...

    Type Alias Fn

    Fn: () => unknown

    The task function.

    If you need to provide a custom duration for the task (e.g.: because you want to measure a specific part of its execution), you can return an object with a overriddenDuration field. You should still use bench.now() to measure that duration. When the task function batches several inner calls, also return overriddenIterationCost so the time budget reflects the whole iteration while samples record batch means.

    Task results are unrestricted. See FnReturnedObject for explicit compile-time checks of measurement fields.

    Type Declaration

      • (): unknown
      • Returns unknown