Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/levo/templates/new-project/lib/lib.deno_runtime.d.ts>Performance

Server side rendering with The Elm Architecture in Deno
Latest
interface Performance
import { type Performance } from "https://deno.land/x/levo@v0.0.27/templates/new-project/lib/lib.deno_runtime.d.ts";

Deno supports user timing Level 3 (see: https://w3c.github.io/user-timing) which is not widely supported yet in other runtimes. These types are here so that these features are still available when using the Deno namespace in conjunction with other type libs, like dom.

Methods

mark(markName: string, options?: PerformanceMarkOptions): PerformanceMark

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

measure(measureName: string, options?: PerformanceMeasureOptions): PerformanceMeasure

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

clearMarks(markName?: string): void

Removes the stored timestamp with the associated name.

clearMeasures(measureName?: string): void

Removes stored timestamp with the associated name.

getEntries(): PerformanceEntryList
getEntriesByName(name: string, type?: string): PerformanceEntryList
getEntriesByType(type: string): PerformanceEntryList
mark(markName: string, options?: PerformanceMarkOptions): PerformanceMark

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

measure(measureName: string, options?: PerformanceMeasureOptions): 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 milliseconds.

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

const t = performance.now();
console.log(`${t} ms since start!`);
variable Performance
import { Performance } from "https://deno.land/x/levo@v0.0.27/templates/new-project/lib/lib.deno_runtime.d.ts";

type

{ prototype: Performance; new (): Performance; }