latency-measurement

Measure sub-microsecond latencies using calibrated TSC and wait-free histograms.

6|Updated Feb 5, 2026
One-click install
npx skills add https://github.com/maschad/my-claude --skill latency-measurement
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: latency-measurement
Source: https://github.com/maschad/my-claude/tree/main/skills/latency-measurement
Command: npx skills add https://github.com/maschad/my-claude --skill latency-measurement

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Measure sub-microsecond latencies using architecture-specific timestamp counters (TSC) and wait-free histograms, enabling precise timing in real-time and latency-critical systems.

Core Features & Use Cases

  • Architecture-specific TSC reading for ARM64/x86_64 with minimal overhead.
  • Calibrated TSC-to-nanosecond conversion and startup initialization.
  • Logarithmic histogram with wait-free recording and simple percentile calculations.
  • Concurrent measurements with low contention and minimal allocations.

Quick Start

Initialize TSC calibration at startup, then record latencies with the histogram in hot paths.

Frequently Asked Questions about latency-measurement

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I measure sub-microsecond latency in high-frequency concurrent workloads?

Measure sub-microsecond latency by reading architecture-specific timestamp counters (TSC) and recording values into wait-free logarithmic histograms. This approach provides precise timing with minimal overhead for latency-sensitive systems.

What is TSC calibration and why is it needed for latency benchmarking?

TSC calibration converts raw timestamp counter ticks into nanoseconds at startup. It ensures accurate latency measurement by synchronizing the architecture-specific rdtsc readings with real-time values for precise percentile reporting.

Can I calculate P99 latency percentiles without adding contention to concurrent systems?

Yes, you can calculate P50, P95, and P99 percentiles using wait-free logarithmic histogram buckets. This method enables concurrent measurements with low contention and minimal allocations in real-time workloads.

Does this latency measurement approach support both ARM64 and x86_64 architectures?

Yes, the latency measurement supports both ARM64 and x86_64 architectures through architecture-specific TSC reading. It applies rdtsc instructions tailored to each platform to maintain low overhead during concurrent benchmarks.

What is the best way to record latency in hot paths without affecting performance?

Record latency in hot paths using wait-free logarithmic histograms after initializing TSC calibration at startup. This provides low-contention concurrent measurements and outputs a concise summary of percentile distributions.