---
source: https://iinventedlight.com/library/notes/node-perf-hooks.md
title: "Node.js perf_hooks - performance.now, timerify and PerformanceObserver"
license: CC-BY-4.0
license_url: https://creativecommons.org/licenses/by/4.0/
source_license: "MIT (Node.js API docs); MIT (nodejs/node (GitHub)); prose restates cited source lines in own words"
license_family: mixed-green
attribution: "Summary by iinventedlight (AI-assisted). Sources: Node.js API docs, Performance measurement APIs; nodejs/node (GitHub), doc/api/perf_hooks.md. MIT (https://raw.githubusercontent.com/nodejs/node/main/LICENSE). Copyright Node.js contributors."
author: "iinventedlight (synthesis of cited sources); text drafted with AI assistance"
date: 2026-11-18
status: published
approved_by: "Cole Withington, 2026-11-20 13:14 PT: \"Publish the full batch and rewrite the 6 live notes\""
checked_on: 2026-11-18
as_of: 2026-11-18
confidence: medium
untested: "Not reproduced (2026-11-18). Official docs and source files were read; no test suite, server, or API call was run for this note."
category: coding-references
topic_area: "code-web: node perf hooks"
tags: [node, performance, perf-hooks, timing, histogram]
client: Librarian
sources:
  - id: S1
    title: "Performance measurement APIs"
    publisher: Node.js API docs
    url: https://nodejs.org/api/perf_hooks.html
    accessed: 2026-11-18
    license: "MIT"
  - id: S2
    title: "doc/api/perf_hooks.md"
    publisher: nodejs/node (GitHub)
    url: https://github.com/nodejs/node/blob/main/doc/api/perf_hooks.md
    accessed: 2026-11-18
    license: "MIT"
---
# Node.js perf_hooks - performance.now, timerify and PerformanceObserver
**Answer:** `performance.now()` returns the current high resolution millisecond timestamp, measured from an origin in this process. `PerformanceObserver` collects performance entries. `timerify` wraps a function in a new function that measures the running time of the wrapped function.

## Examples

```js
import { performance, PerformanceObserver, timerify } from 'node:perf_hooks';

const t0 = performance.now();
// ... work ...
console.log(performance.now() - t0, 'ms');

const obs = new PerformanceObserver((list) => {
  for (const entry of list.getEntries()) console.log(entry.name, entry.duration);
});
obs.observe({ entryTypes: ['function', 'measure'] });

const wrapped = timerify(function work() { /* ... */ });
wrapped();
performance.mark('a');
performance.mark('b');
performance.measure('a to b', 'a', 'b');
```

## Rules

- `performance.mark` creates a new PerformanceMark entry in the Performance Timeline.

## See also

- [node-process-and-console](https://iinventedlight.com/library/notes/node-process-and-console/)

## Claims

- id: C1
  claim: performance.now returns a high-resolution millisecond timestamp.
  source: S2
  evidence: "Returns the current high resolution millisecond timestamp"

- id: C2
  claim: PerformanceObserver receives performance entries.
  source: S1
  evidence: "PerformanceObserver"

- id: C3
  claim: Marks are created in the Performance Timeline.
  source: S2
  evidence: "Creates a new `PerformanceMark` entry in the Performance Timeline"

## Sources

- [S1] Performance measurement APIs. Node.js API docs. https://nodejs.org/api/perf_hooks.html . License: MIT. Accessed 2026-11-18.

- [S2] doc/api/perf_hooks.md. nodejs/node (GitHub). https://github.com/nodejs/node/blob/main/doc/api/perf_hooks.md . License: MIT. Accessed 2026-11-18.

License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: Node.js API docs, Performance measurement APIs; nodejs/node (GitHub), doc/api/perf_hooks.md. MIT (https://raw.githubusercontent.com/nodejs/node/main/LICENSE). Copyright Node.js contributors. Text was condensed and changed from the originals.

---

Agents: [/agents.md](/agents.md) | [/.well-known/agent-library.json](/.well-known/agent-library.json).
