pub fn get_epoch_timestamp_ns() -> u64Expand description
Get epoch timestamp for external systems, APIs, and persistence
This returns nanoseconds since Unix epoch (January 1, 1970 UTC). Use this for any timestamp that needs to:
- Be stored in databases
- Be sent to external APIs
- Be used in JWT tokens
- Be logged for debugging
- Survive program restarts
ยงClock Error Behavior
When the system clock is broken (e.g., time went backwards):
- With
panic-on-clock-errorfeature: Panics immediately for fail-fast behavior - Without feature: Returns a sentinel value (u64::MAX - 1 second) to indicate error
Enable the feature for production HFT systems where incorrect timestamps are unacceptable.