Performance

performance.mark()

Records a named mark on the performance timeline. Names can be reused; remove marks that are no longer needed to avoid unbounded timeline growth. Tested on Node.js 22.16.0. Example output (one line per entry): ["fixture:start mark"].

Formal Syntax & Structure

nodejs syntaxnodejs
performance.mark(name[, options])

Parameters & Attributes

NameTypeDescription
namestringMark name.
optionsobjectOptional startTime and detail.

Return Value

PerformanceMark

Created mark.

Working Example

Example Snippetnodejs
import { performance } from 'node:perf_hooks';try {    const mark = performance.mark('fixture:start');    console.log(mark.name, mark.entryType);}finally {    performance.clearMarks('fixture:start');}
Node.js Reference