A function that benchmarks another function by measuring its execution time and the size of its result.
The type of the result returned by the benchmarked function.
The function to benchmark. It can return either a synchronous or asynchronous result.
Optional configuration options for the benchmark.
The result of the benchmarked function (either synchronously or as a Promise).
benchmark(() => myFunction(), { label: "My Function Benchmark", onBenchmarkComplete: (info) => { console.log(info);}}); Copy
benchmark(() => myFunction(), { label: "My Function Benchmark", onBenchmarkComplete: (info) => { console.log(info);}});
A function that benchmarks another function by measuring its execution time and the size of its result.