Skip to main content

interface 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.

Methods #

#mark(
markName: string,
): PerformanceMark

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

#measure(
measureName: string,
): PerformanceMeasure

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

Properties #

#timeOrigin: number
readonly

Returns a timestamp representing the start of the performance measurement.

Methods #

#clearMarks(markName?: string): void

Removes the stored timestamp with the associated name.

#clearMeasures(measureName?: string): void

Removes stored timestamp with the associated name.

Removes all performance entries with an entryType of "resource" from the performance timeline and sets the size of the performance resource data buffer to zero.

Note: Deno does not currently track resource timings, so this method has no observable effect. It is provided for API compatibility.

#setResourceTimingBufferSize(maxSize: number): void

Sets the desired size of the browser's resource timing buffer which stores the "resource" performance entries.

Note: Deno does not currently track resource timings, so this method has no observable effect. It is provided for API compatibility.

#getEntriesByName(
name: string,
type?: string,
): PerformanceEntryList
#mark(
markName: string,
): PerformanceMark

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

#measure(
measureName: string,
): PerformanceMeasure

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

#measure(
measureName: string,
startMark?: string,
endMark?: string,
): PerformanceMeasure

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

#now(): number

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

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

Returns a JSON representation of the performance object.

Did you find what you needed?

Privacy policy