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.
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
overriddenDurationfield. You should still usebench.now()to measure that duration. When the task function batches several inner calls, also returnoverriddenIterationCostso thetimebudget reflects the whole iteration while samples record batch means.Task results are unrestricted. See FnReturnedObject for explicit compile-time checks of measurement fields.