Performance

Deno supports User Timing Level 3 which is not widely supported yet in other runtimes.

Check out the Performance API documentation on MDN for further information about how to use the API.

interface Performance {
mark(markName: string, options?: PerformanceMarkOptions): PerformanceMark;
measure(measureName: string, options?: PerformanceMeasureOptions): PerformanceMeasure;
}
class Performance extends EventTarget {
constructor();
readonly timeOrigin: number;
 
clearMarks(markName?: string): void;
clearMeasures(measureName?: string): void;
getEntries(): PerformanceEntryList;
getEntriesByName(name: string, type?: string): PerformanceEntryList;
getEntriesByType(type: string): PerformanceEntryList;
mark(markName: string, options?: PerformanceMarkOptions): PerformanceMark;
measure(measureName: string, options?: PerformanceMeasureOptions): PerformanceMeasure;
measure(
measureName: string,
startMark?: string,
endMark?: string,
): PerformanceMeasure;
now(): number;
toJSON(): any;
}

§Methods

§
mark(markName: string, options?: PerformanceMarkOptions): PerformanceMark
[src]

Stores a timestamp with the associated name (a "mark").

§
measure(measureName: string, options?: PerformanceMeasureOptions): PerformanceMeasure
[src]

Stores the DOMHighResTimeStamp duration between two marks along with the associated name (a "measure").

§Extends

§
EventTarget
[src]

§Constructors

§
new Performance()
[src]

§Properties

§
timeOrigin: number
[src]

Returns a timestamp representing the start of the performance measurement.

§Methods

§
clearMarks(markName?: string): void
[src]

Removes the stored timestamp with the associated name.

§
clearMeasures(measureName?: string): void
[src]

Removes stored timestamp with the associated name.

§
getEntriesByName(name: string, type?: string): PerformanceEntryList
[src]
§
getEntriesByType(type: string): PerformanceEntryList
[src]
§
mark(markName: string, options?: PerformanceMarkOptions): PerformanceMark
[src]

Stores a timestamp with the associated name (a "mark").

§
measure(measureName: string, options?: PerformanceMeasureOptions): PerformanceMeasure
[src]

Stores the DOMHighResTimeStamp duration between two marks along with the associated name (a "measure").

measure(measureName: string, startMark?: string, endMark?: string): PerformanceMeasure
[src]

Stores the DOMHighResTimeStamp duration between two marks along with the associated name (a "measure").

§
now(): number
[src]

Returns a current time from Deno's start in milliseconds.

Use the permission flag --allow-hrtime return a precise value.

const t = performance.now();
console.log(`${t} ms since start!`);
§
toJSON(): any
[src]

Returns a JSON representation of the performance object.