pub struct TimingUpkeep { /* private fields */ }Expand description
Upkeep handle for the high-performance timing system
Implementations§
Source§impl TimingUpkeep
impl TimingUpkeep
Sourcepub fn start(update_interval: Duration) -> Self
pub fn start(update_interval: Duration) -> Self
Create and start a new timing upkeep thread
This configures the quanta crate’s “recent time” feature, which provides ultra-low-overhead access to a slightly-delayed global time. This is useful for high-performance applications where the cost of time queries is significant.
The upkeep thread updates the global time value at the specified interval, allowing other threads to read it without the overhead of a full time query.
§Arguments
update_interval- How often to update the global time (smaller values provide more accurate time but increase CPU usage)
§Returns
A handle to the upkeep thread. The thread runs until this handle is dropped.
Sourcepub fn update_recent_time()
pub fn update_recent_time()
Manually update the global recent time
This is useful if you don’t want to use the upkeep thread but still want to occasionally update the global time.
Trait Implementations§
Source§impl Debug for TimingUpkeep
impl Debug for TimingUpkeep
Auto Trait Implementations§
impl Freeze for TimingUpkeep
impl !RefUnwindSafe for TimingUpkeep
impl Send for TimingUpkeep
impl Sync for TimingUpkeep
impl Unpin for TimingUpkeep
impl !UnwindSafe for TimingUpkeep
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more