execution-engine
Version:
A TypeScript library for tracing and visualizing code execution workflows.
57 lines • 2.75 kB
TypeScript
import { TimerDetailsModel } from '../common/models/timer.model';
/**
* A class for measuring the execution time of code blocks.
*/
export declare class ExecutionTimer {
private timer;
/**
* Creates an instance of ExecutionTimer.
* @param executionId - An optional identifier for the execution timer. Defaults to 'default'.
*/
constructor(executionId?: string);
/**
* Starts the execution timer.
* @param executionId - An optional identifier for the execution timer. Defaults to 'default'.
*/
start(executionId?: string): void;
/**
* Stops the execution timer.
* @param executionId - An optional identifier for the execution timer. Defaults to 'default'.
*/
stop(executionId?: string): void;
/**
* Gets the duration of the execution timer in milliseconds.
* @param executionId - An optional identifier for the execution timer. Defaults to 'default'.
* @param fractionDigits – The number of digits to appear after the decimal point; should be a value between 0 and 100, inclusive.
* @returns The duration of the execution timer in milliseconds.
*/
getDuration(executionId?: string, fractionDigits?: number): number;
/**
* Gets the start date of the execution timer.
* @param executionId - An optional identifier for the execution timer. Defaults to 'default'.
* @returns The start date of the execution timer.
*/
getStartDate(executionId?: string): Date | undefined;
/**
* Gets the end date of the execution timer.
* @param executionId - An optional identifier for the execution timer. Defaults to 'default'.
* @returns The end date of the execution timer.
*/
getEndDate(executionId?: string): Date | undefined;
/**
* Gets the human-readable elapsed time of the execution timer.
* @param executionId - An optional identifier for the execution timer. Defaults to 'default'.
* @param fractionDigits – The number of digits to appear after the decimal point; should be a value between 0 and 100, inclusive.
* @returns A string representing the human-readable elapsed time.
*/
getElapsedTime(executionId?: string, fractionDigits?: number): string | undefined;
/**
* Gets details of a specific execution timer.
* @param executionId - The timer ID. Defaults to 'default'.
* @param durationFractionDigits - Decimal places for milliseconds.
* @param elapsedTimeFractionDigits - Decimal places for milliseconds.
* @returns An object containing timer details.
*/
getInfo(executionId?: string, durationFractionDigits?: number, elapsedTimeFractionDigits?: number): TimerDetailsModel;
}
//# sourceMappingURL=executionTimer.d.ts.map