MCPcopy Create free account
hub / github.com/NthTensor/Forte / ticks

Function ticks

src/time.rs:7–20  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

5//! architecture and machine (for example, a fixed-frequency system counter on
6//! Arm, and the nominal CPU frequency on x86), so ticks are only comparable
7//! with other ticks read on the same machine. [`ticks_per_second`] measures the rate, and
8//! [`duration_to_ticks`] and [`ticks_to_duration`] convert with it.
9
10use core::time::Duration;
11use std::sync::OnceLock;
12use std::time::Instant;
13
14/// How often a worker shares the work it has queued with idle siblings.
15///
16/// Work that finishes within one heartbeat is never shared, so it runs without
17/// any synchronization; longer work is offered to other workers about this
18/// often.
19pub const HEARTBEAT: Duration = Duration::from_micros(10);
20
21/// Returns the rate of [`ticks`], in ticks per second.
22///
23/// The rate is measured against [`Instant`] the first time this is called,

Callers 1

promoteMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected