helix-driver-native 0.1.15

Helix 的 Tokio Native 平台驱动
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
//! NativeClock — SystemTime

use helix_core::ports::Clock;

#[derive(Clone, Debug)]
pub struct NativeClock;

impl Clock for NativeClock {
    fn now_ms(&self) -> u64 {
        use std::time::{SystemTime, UNIX_EPOCH};
        SystemTime::now()
            .duration_since(UNIX_EPOCH)
            .unwrap_or_default()
            .as_millis() as u64
    }
}