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...
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
| File | Contains | Use For |
|---|---|---|
SKILL.md | Entry point: scope, routing table, and workflow. | Start here. |
docs/workers-runtime-apis-performance-and-timers-workflow-guide.md | Documentation 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.text | A 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.text | A 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
- Open the most relevant file under
docs/for the exact documented workflow and wording. - Open
schemas/files for exact structured contracts. - Open
examples/files for concrete requests, commands, snippets, and manifests. - 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
