import { AnyFunction } from '../../types'; /** * Calculates the execution time of a function in milliseconds * * @since v1.7.0 * @category Function * @param {{ now: () => number }} performance - The performance object;
For use in the browser, simply pass in performance which is a native object; for use in NodeJS, use import { performance } from 'perf_hooks';
* @param {number} [n=1] - The number of times to execute the function; if greater than 1, the average time is returned * @returns {(func: AnyFunction, ...args: any[]) => number} * @example * const addOne = x => x + 1; * calcPerformance(performance)(addOne, 25); * * // exec 'addOne' 100 times and return the average * calcPerformance(performance, 100)(addOne, 25); */ export declare const executionTime: (performance: { now: () => number; }, n?: number) => (func: AnyFunction, ...args: any[]) => number;