An efficient low-precision timestamp source suitable for high-frequency querying.
The fast_time crate provides a Clock that can efficiently capture timestamps with low overhead,
making it ideal for high-frequency querying scenarios such as metrics collection and logging.
The clock prioritizes efficiency over precision and provides monotonic timestamps.
use Clock;
// Create a clock for efficient timestamp capture
let mut clock = new;
// Capture timestamps rapidly
let start = clock.now;
// Simulate some work
sleep;
let elapsed = start.elapsed;
println!;
// High-frequency timestamp collection
let mut timestamps = Vecnew;
for _ in 0..1000
// Convert to std::time::Instant for interoperability
let fast_instant = clock.now;
let std_instant: Instant = fast_instant.into;
See also
More details in the package documentation.
This is part of the Folo project that provides mechanisms for high-performance hardware-aware programming in Rust.