Module time

Source
Expand description

Time utility functions for the monitor module

This module provides high-precision timing utilities using the quanta crate for monotonic time measurements and standard library functions for epoch timestamps.

Structs§

TimingUtils
High-precision clock for timing operations

Functions§

current_date
Get current date string in YYYYMMDD format
current_datetime
Get current datetime string in ISO format
days_ago
Get date that is N days ago from now
monotonic_millis
Get monotonic timestamp in milliseconds since program start Use this for performance measurements, durations, and intervals WARNING: This is NOT epoch time - do not use for persistence or external APIs
monotonic_nanos
Get monotonic timestamp in nanoseconds since program start Use this for performance measurements, durations, and intervals WARNING: This is NOT epoch time - do not use for persistence or external APIs
now_millis
Get current timestamp in milliseconds since Unix epoch
now_nanos
Get current timestamp in nanoseconds since Unix epoch
now_seconds
Get current timestamp in seconds since Unix epoch
timing
Get the global timing utility instance