UNPKG

1.06 kBTypeScriptView Raw
1/**
2 * PerfData interface.
3 *
4 * @internal
5 */
6export interface IPerfData {
7 duration: number;
8 timeStamp: number;
9}
10/**
11 * PerfMeasurement interface.
12 *
13 * @internal
14 */
15export interface IPerfMeasurement {
16 totalDuration: number;
17 count: number;
18 all: IPerfData[];
19}
20/**
21 * PerfSummary interface.
22 *
23 * @internal
24 */
25export interface IPerfSummary {
26 [key: string]: IPerfMeasurement;
27}
28/**
29 * Performance helper class for measuring things.
30 *
31 * @public
32 * {@docCategory FabricPerformance}
33 */
34export declare class FabricPerformance {
35 static summary: IPerfSummary;
36 private static _timeoutId;
37 /**
38 * Measures execution time of the given syncronous function. If the same logic is executed multiple times,
39 * each individual measurement will be collected as well the overall numbers.
40 * @param name - The name of this measurement
41 * @param func - The logic to be measured for execution time
42 */
43 static measure(name: string, func: () => void): void;
44 static reset(): void;
45 static setPeriodicReset(): void;
46}