iso-bench
Version:
Small benchmark library focused in avoiding optimization/deoptimization pollution between tests by isolating them.
25 lines (24 loc) • 884 B
TypeScript
import STREAM from "stream";
import { Test, TestOptions } from "./Test";
import { Processor } from "./Processor";
export type IsoBenchOptions = {
parallel?: number;
} & TestOptions;
export declare class IsoBench {
readonly name: string;
processors: Processor[];
tests: Test[];
currentTests: Test[];
options: Required<IsoBenchOptions>;
running: boolean;
constructor(name?: string, options?: IsoBenchOptions);
static IfMaster(cb: () => void): void;
add(name: string, callback: () => void, options?: TestOptions): this;
add<T>(name: string, callback: (setup: T) => void, setup: () => T, options?: TestOptions): this;
addProcessor(processorCallback: () => Processor): this;
consoleLog(): this;
streamLog(streamCallback: () => STREAM.Writable): this;
endGroup(name: string): this;
run(): Promise<void>;
private _start;
}