UNPKG

@utilify/core

Version:

Modern, strongly typed, and safe utility function library for JavaScript and TypeScript. Includes type checking, manipulation of arrays, objects, strings, dates, colors, numbers, regular expressions, and more. Compatible with Browser, Node.js, Deno, and B

14 lines 670 B
/** * @callback BenchmarkCallback * @returns {void|Promise<void>} */ /** * Benchmarks a synchronous or asynchronous function over multiple iterations. * @param {BenchmarkCallback} callback - The function to benchmark. * @param {number} iterations - Number of iterations. * @returns {Promise<number>} The average execution time in milliseconds. * @throws {TypeError} If callback is not a function or iterations is invalid. */ export default function benchmark(callback: () => void, iterations: number): Promise<number>; export default function benchmark(callback: () => Promise<void>, iterations: number): Promise<number>; //# sourceMappingURL=benchmark.d.ts.map