llkv-executor 0.5.0-alpha

Query execution engine for the LLKV toolkit.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
//! Time utility functions for the executor.

use std::time::{SystemTime, UNIX_EPOCH};

/// Returns the current time in microseconds since the Unix epoch.
///
/// This is commonly used for timestamp columns and time-based operations.
/// Falls back to 0 if the system clock is before the Unix epoch (should never happen).
pub fn current_time_micros() -> u64 {
    SystemTime::now()
        .duration_since(UNIX_EPOCH)
        .unwrap_or_default()
        .as_micros() as u64
}