@acromedia/sloth
Version:
Resource profiler for node, utilizing child processes
30 lines (29 loc) • 962 B
TypeScript
import ProfileResults from '../classes/ProfileResults';
declare const _default: (func: (...args: any[]) => any, args?: Array<unknown>, opts?: BenchOptions, profilerOpts?: ProfilerOptions) => Promise<ProfileResults>;
/**
* Benchmarks a function in an isolated process.
*
* @param {Function} func
* The function to benchmark.
*
* @param {Array=} args
* The arguments to supply.
*
* @param {Object=} opts
* Profiler options (see Profiler class).
*
* @param {Function=} opts.setup
* Function that contians code that will run before the main function is run.
*
* Good for using require() and other things that are otherwise declared globally.
*
* @param {Array=} opts.requirements
* Array of required packages. Good alternative to the setup function
*
* @param {Array=} opts.nodeArgs
* Array of arguments to be passed to the Node process
*
* @param {Array=} opts.cliArgs
* Array of args to pass to the file itself
*/
export default _default;