Prompt Buddy logoPrompt Buddy

cloudflare · Cloudflare Workers Docs

Workers Performance and timers

Explains how to use the Performance API in Cloudflare Workers to measure execution timing and subrequest latency, including the security-driven behavior where timers only increment after I/O operations occur in produc...

Import to Prompt Buddy

Derived skill

Files assembled from official documentation

Viewing SKILL.md

Workers Performance and timers

Explains how to use the Performance API in Cloudflare Workers to measure execution timing and subrequest latency, including the security-driven behavior where timers only increment after I/O operations occur in produc...

When To Use

Use when you need to measure the latency of subrequests, KV fetches, or R2 operations within a Worker while accounting for the runtime's security-based timer behavior.

Reference Files

FileContainsUse For
SKILL.mdEntry point: scope, routing table, and workflow.Start here.
docs/workers-runtime-apis-performance-and-timers-workflow-guide.mdDocumentation detailing the subset of the Performance API supported by the Cloudflare Workers runtime, including performance.now() and performance.timeOrigin.Questions about documentation detailing the subset of the Performance API supported by the Cloudflare Workers runtime, including perf...
examples/workers-runtime-apis-performance-and-timers-cloudflare-workers-performan.textA JavaScript code snippet demonstrating how to use the performance.now() API to measure execution time within a Cloudflare Worker.Exact payloads, commands, or snippets shown in A JavaScript code snippet demonstrating how to use the performance.now() API to measure execution time within a Cloud...
examples/workers-runtime-apis-performance-and-timers-cloudflare-workers-performan-2.textA JavaScript code snippet demonstrating how to use the performance.now() API to measure the duration of a fetch request within a Cloudflare Worker.Exact payloads, commands, or snippets shown in A JavaScript code snippet demonstrating how to use the performance.now() API to measure the duration of a fetch reque...

What This Skill Covers

  • The Workers runtime supports a subset of the Performance API ↗, used to measure timing and performance, as well as timing of subrequests and other operations.
  • Main sections: Background, performance.now(), performance.timeOrigin.

Workflow

  1. Open the most relevant file under docs/ for the exact documented workflow and wording.
  2. Open schemas/ files for exact structured contracts.
  3. Open examples/ files for concrete requests, commands, snippets, and manifests.
  4. Do not add behavior or configuration that is not present in the attached source files.

Canonical source: https://developers.cloudflare.com/workers/runtime-apis/performance