UNPKG

@oaklean/profiler

Version:

A library to measure the energy consumption of your javascript/typescript code

19 lines (18 loc) 1.19 kB
import { ProfilerConfig, ProjectReport, IProjectReportExecutionDetailsDuringMeasurement, NanoSeconds_BigInt, ExportAssetHelper } from '@oaklean/profiler-core'; import { PowerMetricsSensorInterface } from './interfaces/powermetrics/PowerMetricsSensorInterface'; import { PerfSensorInterface } from './interfaces/perf/PerfSensorInterface'; import { WindowsSensorInterface } from './interfaces/windows/WindowsSensorInterface'; export declare class Profiler { subOutputDir: string | undefined; config: ProfilerConfig; exportAssetHelper: ExportAssetHelper; executionDetails?: IProjectReportExecutionDetailsDuringMeasurement; private _externalResourceHelper; private _sensorInterface; constructor(subOutputDir?: string); static getSensorInterface(config: ProfilerConfig): PowerMetricsSensorInterface | PerfSensorInterface | WindowsSensorInterface | undefined; loadSensorInterface(): void; static inject(subOutputDir?: string): Promise<Profiler>; start(title: string, executionDetails?: IProjectReportExecutionDetailsDuringMeasurement): Promise<void>; finish(title: string, highResolutionStopTime?: NanoSeconds_BigInt): Promise<ProjectReport>; }