@c4312/matcha
Version:
A caffeine driven, simple command line for benchmarking
32 lines (31 loc) • 899 B
TypeScript
import { MaybeAsync } from './async';
import { Options } from './options';
import { Middleware } from './runner';
/**
* Method used for running benchmarks. Can be stubbed in tests.
*/
export declare type RunFunction = (name: string, options: Options) => Promise<void>;
export interface IBenchmarkCase {
name: string;
fn: MaybeAsync;
middleware: ReadonlyArray<Middleware>;
options?: Options;
}
/**
* A benchmark suite. Wraps around the basic Benchmark.js suites, since they
* don't support asynchronous setup and teardown.
* @see https://github.com/bestiejs/benchmark.js/pull/174
*/
export declare class MatchaSuite {
private readonly runFn;
private readonly benches;
constructor(runFn?: RunFunction);
/**
* Adds a new benchmark case.
*/
addCase(bench: IBenchmarkCase): void;
/**
* Runs all benchmarks.
*/
run(): Promise<void>;
}