Skip to main content

Module timestamp

Module timestamp 

Source
Expand description

High-precision timestamp generation with zero syscall overhead.

This module provides monotonically increasing timestamps using the CPU’s Time Stamp Counter (TSC) on x86_64, avoiding syscalls in the hot path.

§Design

  • Uses quanta crate which calibrates against the system clock once at startup
  • Subsequent reads use RDTSC instruction directly (no syscall)
  • Each shard has its own TimestampGenerator to eliminate contention
  • Monotonicity is guaranteed via atomic CAS operations

Structs§

TimestampGenerator
High-precision timestamp generator using TSC.