Skip to main content
Performance.mark - perf_hooks - Node documentation
method Performance.mark

Usage in Deno

import { type Performance } from "node:perf_hooks";
Performance.mark(
name: string,
options?: MarkOptions,
): PerformanceMark

Creates a new PerformanceMark entry in the Performance Timeline. A PerformanceMark is a subclass of PerformanceEntry whose performanceEntry.entryType is always 'mark', and whose performanceEntry.duration is always 0. Performance marks are used to mark specific significant moments in the Performance Timeline.

The created PerformanceMark entry is put in the global Performance Timeline and can be queried with performance.getEntries, performance.getEntriesByName, and performance.getEntriesByType. When the observation is performed, the entries should be cleared from the global Performance Timeline manually with performance.clearMarks.

Parameters

name: string
optional
options: MarkOptions

Return Type