style: run rustfmt
This commit is contained in:
@@ -2,9 +2,9 @@
|
||||
//!
|
||||
//! 使用 syscall_bypass 提供的快速时间戳避免频繁的系统调用
|
||||
|
||||
use std::time::{Duration, Instant};
|
||||
use once_cell::sync::Lazy;
|
||||
use crate::perf::syscall_bypass::SystemCallBypassManager;
|
||||
use once_cell::sync::Lazy;
|
||||
use std::time::{Duration, Instant};
|
||||
|
||||
/// 全局快速时间提供器
|
||||
static FAST_TIMER: Lazy<FastTimer> = Lazy::new(|| FastTimer::new());
|
||||
@@ -26,11 +26,7 @@ impl FastTimer {
|
||||
let base_instant = Instant::now();
|
||||
let base_nanos = bypass_manager.fast_timestamp_nanos();
|
||||
|
||||
Self {
|
||||
bypass_manager,
|
||||
_base_instant: base_instant,
|
||||
_base_nanos: base_nanos,
|
||||
}
|
||||
Self { bypass_manager, _base_instant: base_instant, _base_nanos: base_nanos }
|
||||
}
|
||||
|
||||
/// 🚀 获取当前时间戳(纳秒) - 使用快速系统调用绕过
|
||||
@@ -107,10 +103,7 @@ impl FastStopwatch {
|
||||
/// 创建并启动计时器
|
||||
#[inline(always)]
|
||||
pub fn start(label: &'static str) -> Self {
|
||||
Self {
|
||||
start_nanos: fast_now_nanos(),
|
||||
label,
|
||||
}
|
||||
Self { start_nanos: fast_now_nanos(), label }
|
||||
}
|
||||
|
||||
/// 获取已耗时(纳秒)
|
||||
|
||||
Reference in New Issue
Block a user