1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
//! # Time Tracking Module
//!
//! This module provides precise time tracking utilities for network operations.
//! It uses monotonic system time to ensure consistent and reliable timing
//! measurements, particularly useful for network latency calculations and
//! timing-sensitive operations.
//!
//! ## Features
//!
//! - Nanosecond precision timing
//! - Monotonic time source
//! - Overflow protection
//! - Debug formatting
//!
//! ## Example
//!
//! ```rust
//! use netbeam::time_tracker::TimeTracker;
//!
//! let tracker = TimeTracker::new();
//! let start_time = tracker.get_global_time_ns();
//!
//! // Perform some operation
//!
//! let elapsed = tracker.get_global_time_ns() - start_time;
//! println!("Operation took {} ns", elapsed);
//! ```
use Formatter;
/// A utility for tracking time with nanosecond precision.
///
/// TimeTracker provides a consistent way to measure time intervals
/// using the system's monotonic clock. It is particularly useful
/// for measuring network latencies and timing-sensitive operations.
;
/// Debug implementation for TimeTracker.
///
/// Provides a human-readable format showing the current global time
/// in nanoseconds when the TimeTracker is debug-printed.